From 820769071de664372b91fe75f4934083a103205e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 31 Oct 2022 15:33:58 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2=20=D1=81=D0=BA=D1=80?= =?UTF-8?q?=D0=BE=D0=BB=D0=BB=D0=B8=D0=BD=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/AuthorList/AuthorList.vue | 3 ++- client/components/Search/BaseList.js | 3 ++- client/components/Search/Search.vue | 11 ++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) 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';