mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-14 06:06:15 +01:00
Fix show more button appearing in unwanted situations
This commit is contained in:
parent
3e4c28123e
commit
fba46f28ff
3 changed files with 6 additions and 6 deletions
|
@ -32,7 +32,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.length == 0) this.data_ended = true;
|
if (response.data.length == 0 || response.data.length < this.limit) this.data_ended = true;
|
||||||
else this.stream_data = this.stream_data.concat(response.data);
|
else this.stream_data = this.stream_data.concat(response.data);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -49,7 +49,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.length == 0) this.data_ended = true;
|
if (response.data.length == 0 || response.data.length < this.limit) this.data_ended = true;
|
||||||
else this.stream_data = this.stream_data.concat(response.data);
|
else this.stream_data = this.stream_data.concat(response.data);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ export default {
|
||||||
scroll() {
|
scroll() {
|
||||||
window.onscroll = () => {
|
window.onscroll = () => {
|
||||||
let bottomOfWindow = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop) + window.innerHeight >= document.documentElement.offsetHeight - 5
|
let bottomOfWindow = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop) + window.innerHeight >= document.documentElement.offsetHeight - 5
|
||||||
|
|
||||||
if (bottomOfWindow && !this.data_ended) {
|
if (bottomOfWindow && !this.data_ended) {
|
||||||
this.start_idx += this.limit
|
this.start_idx += this.limit
|
||||||
this.loadMore()
|
this.loadMore()
|
||||||
|
|
|
@ -39,10 +39,10 @@ export default {
|
||||||
},
|
},
|
||||||
scroll () {
|
scroll () {
|
||||||
window.onscroll = () => {
|
window.onscroll = () => {
|
||||||
let bottomOfWindow = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop) + window.innerHeight === document.documentElement.offsetHeight
|
let bottomOfWindow = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop) + window.innerHeight >= document.documentElement.offsetHeight - 5
|
||||||
if (bottomOfWindow && !this.dataEnded) {
|
if (bottomOfWindow && !this.dataEnded) {
|
||||||
this.startIdx += this.limit;
|
this.startIdx += this.limit
|
||||||
this.loadContent();
|
this.loadContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue