diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue index 7401388..d09ea07 100644 --- a/client/components/Search/AuthorList/AuthorList.vue +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -185,6 +185,8 @@ class AuthorList extends BaseList { } async expandAuthor(item) { + this.$emit('listEvent', {action: 'ignoreScroll'}); + const expanded = _.cloneDeep(this.expandedAuthor); const key = item.author; @@ -197,7 +199,6 @@ class AuthorList extends BaseList { expanded.shift(); } - //this.$emit('listEvent', {action: 'ignoreScroll'}); this.setSetting('expandedAuthor', expanded); } else { const i = expanded.indexOf(key); diff --git a/client/components/Search/BaseList.js b/client/components/Search/BaseList.js index 959535f..df2e934 100644 --- a/client/components/Search/BaseList.js +++ b/client/components/Search/BaseList.js @@ -229,6 +229,8 @@ export default class BaseList { } async expandSeries(seriesItem) { + this.$emit('listEvent', {action: 'ignoreScroll'}); + const expandedSeries = _.cloneDeep(this.expandedSeries); const key = seriesItem.key; @@ -241,7 +243,6 @@ export default class BaseList { this.getSeriesBooks(seriesItem); //no await - //this.$emit('listEvent', {action: 'ignoreScroll'}); this.setSetting('expandedSeries', expandedSeries); } else { const i = expandedSeries.indexOf(key); diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index a370776..d900bc4 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -744,11 +744,13 @@ class Search { } onScroll() { - if (this.ignoreScrolling) - return; - const curScrollTop = this.$refs.scroller.scrollTop; + if (this.ignoreScrolling) { + this.lastScrollTop = curScrollTop; + return; + } + if (!this.lastScrollTop) this.lastScrollTop = 0; if (!this.lastScrollTop2) @@ -756,6 +758,9 @@ class Search { if (curScrollTop - this.lastScrollTop > 0) { this.$refs.toolPanel.style.position = 'relative'; + if (this.lastScrollTop2 <= curScrollTop - this.$refs.toolPanel.clientHeight) + this.lastScrollTop2 = 0; + this.$refs.toolPanel.style.top = `${this.lastScrollTop2}px`; } else { this.$refs.toolPanel.style.position = 'sticky';