More selective scroll detection

This commit is contained in:
Jiang Yio 2023-05-25 06:20:23 -04:00
parent d08f76ec99
commit cdbcc51927

View File

@ -532,9 +532,9 @@
); );
}, },
mounted() { mounted() {
this.observer_scroller = new IntersectionObserver(() => { if((this.date_next) && (!this.query.replace(/^\s+|\s+$/g, '')) && (this.selection)) this.date_begin = this.date_next; }, { root: this.$refs.scroller, rootMargin: '25%' }); this.observer_scroller = new IntersectionObserver(([entry]) => { if((entry.isIntersecting) && (this.selection) && (this.date_next) && (!this.is_loading) && (!this.query.replace(/^\s+|\s+$/g, ''))) this.date_begin = this.date_next; }, { root: this.$refs.scroller, rootMargin: '25%' });
this.observer_scroller.observe(this.$refs.bottom); this.observer_scroller.observe(this.$refs.bottom);
this.observer_viewport = new IntersectionObserver(() => { if((this.date_next) && (!this.query.replace(/^\s+|\s+$/g, '')) && (!this.selection)) this.date_begin = this.date_next; }, { rootMargin: '25%' }); this.observer_viewport = new IntersectionObserver(([entry]) => { if((entry.isIntersecting) && (!this.selection) && (this.date_next) && (!this.is_loading) && (!this.query.replace(/^\s+|\s+$/g, ''))) this.date_begin = this.date_next; }, { rootMargin: '25%' });
this.observer_viewport.observe(this.$refs.bottom); this.observer_viewport.observe(this.$refs.bottom);
}, },
destroyed() { destroyed() {