mirror of https://github.com/kiwix/libkiwix.git
Give a name to function for updating book count
Extracts function updateBookCount() from the unnamed function in resize event.
This commit is contained in:
parent
9f545718c2
commit
489dfc1123
|
@ -429,13 +429,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', (event) => {
|
function updateBookCount(event) {
|
||||||
if (timer) {clearTimeout(timer)}
|
if (timer) {clearTimeout(timer)}
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
incrementalLoadingParams.count = incrementalLoadingParams.count && viewPortToCount();
|
incrementalLoadingParams.count = incrementalLoadingParams.count && viewPortToCount();
|
||||||
loadSubset();
|
loadSubset();
|
||||||
}, 100, event);
|
}, 100, event);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
window.addEventListener('resize', (event) => updateBookCount(event));
|
||||||
|
|
||||||
window.addEventListener('scroll', loadSubset);
|
window.addEventListener('scroll', loadSubset);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue