enhance(client): Better element visible detection
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import Vue from 'vue';
|
||||
import { getScrollPosition, onScrollTop } from './scroll';
|
||||
import { onScrollTop, isTopVisible } from './scroll';
|
||||
|
||||
const SECOND_FETCH_LIMIT = 30;
|
||||
|
||||
@@ -148,7 +147,7 @@ export default (opts) => ({
|
||||
},
|
||||
|
||||
prepend(item) {
|
||||
const isTop = this.isBackTop || (document.body.contains(this.$el) && (getScrollPosition(this.$el) === 0));
|
||||
const isTop = this.isBackTop || (document.body.contains(this.$el) && isTopVisible(this.$el));
|
||||
|
||||
if (isTop) {
|
||||
// Prepend the item
|
||||
|
Reference in New Issue
Block a user