From 3ee502c3a44a3c6fa674f06a32c7f2dfb2118fb3 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 13 Dec 2017 23:17:37 +0300 Subject: [PATCH] fixup/cosmetics --- popup/search-results.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/popup/search-results.js b/popup/search-results.js index 6cf29582..98f6e2f2 100755 --- a/popup/search-results.js +++ b/popup/search-results.js @@ -112,9 +112,11 @@ window.addEventListener('showStyles:done', function _() { addEventListener('scroll', loadMoreIfNeeded, {passive: true}); if (FIREFOX) { + let lastScrollbarWidth; addEventListener('resize', () => { const scrollbarWidth = window.innerWidth - document.scrollingElement.clientWidth; - if (scrollbarWidth !== parseFloat(document.body.style.paddingRight)) { + if (lastScrollbarWidth !== scrollbarWidth) { + lastScrollbarWidth = scrollbarWidth; dom.marginLeft = dom.marginLeft || parseFloat(getComputedStyle(dom.container).marginLeft); const shift = dom.container.getBoundingClientRect().left - dom.marginLeft; document.body.style.setProperty('padding',