From 9d8e2e20fb988cea0998fb13771abbfe58ff9f4f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 20 Apr 2018 16:03:37 -0400 Subject: [PATCH] fix firewall pane's save/revert not showing up when scrolled down on small screens --- src/js/popup.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index 091180420..51bfb7ae7 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -62,14 +62,15 @@ if ( // - Its vertical position depends on the height of the popup title bar // - Its horizontal position depends on whether there is a vertical scrollbar. var positionRulesetTools = function() { - document.getElementById('rulesetTools').style.setProperty( - 'top', - (document.getElementById('appinfo').getBoundingClientRect().bottom + 3) + 'px' - ); - document.getElementById('rulesetTools').style.setProperty( - 'left', - (document.getElementById('firewallContainer').getBoundingClientRect().left + 3) + 'px' - ); + var vpos = document.getElementById('appinfo') + .getBoundingClientRect() + .bottom + window.scrollY + 3; + var hpos = document.getElementById('firewallContainer') + .getBoundingClientRect() + .left + window.scrollX + 3; + var style = document.getElementById('rulesetTools').style; + style.setProperty('top', (vpos >>> 0) + 'px'); + style.setProperty('left', (hpos >>> 0) + 'px'); }; // https://github.com/chrisaljoudi/uBlock/issues/996