From 361e7312305359885325e72d8a56a4fecd5c3617 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 16 Nov 2014 20:37:10 +0000 Subject: [PATCH] Replaced unnecessary querySelector()s. --- resources/report/js/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 6a3de87c..dfa9e705 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -999,9 +999,9 @@ function toggleDrawer(evt) { function handleSidebarClick(evt) { if (evt.target.hasAttribute('data-index')) { window.location.hash = ''; - document.getElementById('main').querySelector('core-list').scrollToItem(evt.target.getAttribute('data-index')); + document.getElementById('main').lastElementChild.scrollToItem(evt.target.getAttribute('data-index')); /* However, the scroll bar that the plugin card list uses is for the whole main content area, so the position is offset by the heights of the summary and general messages cards. Adjust to compensate. */ - document.getElementById('main').scrollTop += document.getElementById('main').querySelector('core-list').offsetTop; + document.getElementById('main').scrollTop += document.getElementById('main').lastElementChild.offsetTop; } } function handleQuit(evt) { @@ -1283,7 +1283,7 @@ function onFocus(evt) { window.addEventListener('polymer-ready', function(e) { /* Set the plugin list's scroll target to its parent. */ - document.getElementById('main').querySelector('core-list').scrollTarget = document.getElementById('main'); + document.getElementById('main').lastElementChild.scrollTarget = document.getElementById('main'); require(['bower_components/marked/lib/marked', 'js/l10n', 'js/plugin', 'js/filters'], function(markedResponse, l10nResponse) { marked = markedResponse;