mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 12:43:06 +08:00
Fix global search endless scroller for big screens [SCI-10736]
This commit is contained in:
parent
f94d2b72eb
commit
069a582432
1 changed files with 8 additions and 4 deletions
|
@ -88,11 +88,13 @@ export default {
|
|||
handleScroll() {
|
||||
if (this.loading || !this.selected) return;
|
||||
|
||||
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 50) {
|
||||
if (this.results.length < this.total) {
|
||||
this.loadData();
|
||||
this.$nextTick(() => {
|
||||
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 50) {
|
||||
if (this.results.length < this.total) {
|
||||
this.loadData();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
changeSort(sort) {
|
||||
this.sort = sort;
|
||||
|
@ -136,6 +138,8 @@ export default {
|
|||
this.disabled = response.data.meta.disabled;
|
||||
this.loading = false;
|
||||
this.page = response.data.meta.next_page;
|
||||
|
||||
this.handleScroll();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
Loading…
Reference in a new issue