|
|
@@ -28,11 +28,9 @@ this.lazyLoader = this.lazyLoader || (() => {
|
|
|
|
|
|
return {
|
|
|
process: options => {
|
|
|
- const clientHeight = document.documentElement.clientHeight;
|
|
|
- const clientWidth = document.documentElement.clientWidth;
|
|
|
- const scrollHeight = Math.max(document.documentElement.scrollHeight - (clientHeight * 1.5), 0);
|
|
|
- const scrollWidth = Math.max(document.documentElement.scrollWidth - (clientWidth * 1.5), 0);
|
|
|
- if (scrollY <= scrollHeight && scrollX <= scrollWidth) {
|
|
|
+ const maxScrollY = Math.max(document.documentElement.scrollHeight - (document.documentElement.clientHeight * 1.5), 0);
|
|
|
+ const maxScrollX = Math.max(document.documentElement.scrollWidth - (document.documentElement.clientWidth * 1.5), 0);
|
|
|
+ if (scrollY <= maxScrollY && scrollX <= maxScrollX) {
|
|
|
return process(options);
|
|
|
} else {
|
|
|
return Promise.resolve();
|