On intersection, set the page number instead of prefetching. Setting the page number prefetches automatically.
This commit is contained in:
parent
5e2bf7fc84
commit
d7fc15ce81
1 changed files with 3 additions and 3 deletions
|
|
@ -129,7 +129,7 @@ export class InfiniteScrollerComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
*/
|
*/
|
||||||
isScrolling: boolean = false;
|
isScrolling: boolean = false;
|
||||||
/**
|
/**
|
||||||
* Whether all prefetched images have loaded on the screen (not neccesarily in viewport)
|
* Whether all prefetched images have loaded on the screen (not necessarily in viewport)
|
||||||
*/
|
*/
|
||||||
allImagesLoaded: boolean = false;
|
allImagesLoaded: boolean = false;
|
||||||
/**
|
/**
|
||||||
|
|
@ -159,7 +159,7 @@ export class InfiniteScrollerComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
/**
|
/**
|
||||||
* Debug mode. Will show extra information. Use bitwise (|) operators between different modes to enable different output
|
* Debug mode. Will show extra information. Use bitwise (|) operators between different modes to enable different output
|
||||||
*/
|
*/
|
||||||
debugMode: DEBUG_MODES = DEBUG_MODES.Outline | DEBUG_MODES.Logs;
|
debugMode: DEBUG_MODES = DEBUG_MODES.None;
|
||||||
/**
|
/**
|
||||||
* Debug mode. Will filter out any messages in here, so they don't hit the log
|
* Debug mode. Will filter out any messages in here, so they don't hit the log
|
||||||
*/
|
*/
|
||||||
|
|
@ -597,7 +597,7 @@ export class InfiniteScrollerComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
this.debugLog('[Intersection] Page ' + imagePage + ' is visible: ', entry.isIntersecting);
|
this.debugLog('[Intersection] Page ' + imagePage + ' is visible: ', entry.isIntersecting);
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
this.debugLog('[Intersection] ! Page ' + imagePage + ' just entered screen');
|
this.debugLog('[Intersection] ! Page ' + imagePage + ' just entered screen');
|
||||||
this.prefetchWebtoonImages(imagePage);
|
this.setPageNum(imagePage);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue