diff --git a/popup/hotkeys.js b/popup/hotkeys.js index 9bed618e..b6abc2d1 100644 --- a/popup/hotkeys.js +++ b/popup/hotkeys.js @@ -204,12 +204,18 @@ var hotkeys = (() => { return; } const style = $('#hotkey-info').style; + const scroller = document.scrollingElement; if (installed.scrollHeight > installed.clientHeight || - document.scrollingElement.scrollHeight > document.scrollingElement.innerHeight) { + scroller.scrollHeight > scroller.innerHeight) { const entryRight = installed.firstElementChild.getBoundingClientRect().right; - style.setProperty('right', window.innerWidth - entryRight + 'px', 'important'); + const right = window.innerWidth - entryRight; + if (parseFloat(style.right) !== right) { + style.setProperty('right', right + 'px', 'important'); + } + } + const bottom = installed.getBoundingClientRect().bottom + window.scrollY; + if (parseFloat(style.height) !== bottom) { + style.setProperty('height', bottom + 'px', 'important'); } - const installedBottom = installed.getBoundingClientRect().bottom + window.scrollY; - style.setProperty('bottom', window.innerHeight - installedBottom + 'px', 'important'); } })();