typos and code cosmetics
This commit is contained in:
parent
50b489478c
commit
c3d9e8030b
|
@ -202,9 +202,9 @@
|
|||
"message": "Cannot function properly because of a known bug in this version of Firefox: chrome.extension.getBackgroundPage() doesn't return a valid result",
|
||||
"description": "Displayed in style manager when unable to connect to the background page"
|
||||
},
|
||||
"genericErrorOccurred": {
|
||||
"message": "An error occured:",
|
||||
"description": "Used in various places to indicate some error occured. The error message is shown on the next line."
|
||||
"genericError": {
|
||||
"message": "Error",
|
||||
"description": "Used in various places to indicate some error occurred."
|
||||
},
|
||||
"genericDisabledLabel": {
|
||||
"message": "Disabled",
|
||||
|
|
|
@ -238,18 +238,16 @@ window.addEventListener('showStyles:done', function _() {
|
|||
}
|
||||
|
||||
function loadMoreIfNeeded(event) {
|
||||
let prefetchPages = 0;
|
||||
let pageToPrefetch = displayedPage;
|
||||
if (event instanceof Event) {
|
||||
const scroller = document.scrollingElement;
|
||||
if (scroller.scrollTop > scroller.scrollHeight / 2 &&
|
||||
(loadMoreIfNeeded.prefetchedPage || 0) <= displayedPage) {
|
||||
prefetchPages = 1;
|
||||
loadMoreIfNeeded.prefetchedPage = displayedPage + 1;
|
||||
if ((loadMoreIfNeeded.prefetchedPage || 0) <= pageToPrefetch &&
|
||||
document.scrollingElement.scrollTop > document.scrollingElement.scrollHeight / 2) {
|
||||
loadMoreIfNeeded.prefetchedPage = ++pageToPrefetch;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (processedResults.length < (displayedPage + prefetchPages) * DISPLAY_PER_PAGE) {
|
||||
if (processedResults.length < pageToPrefetch * DISPLAY_PER_PAGE) {
|
||||
setTimeout(load, DELAY_BEFORE_SEARCHING_STYLES);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user