Поправки багов скроллинга

This commit is contained in:
Book Pauk
2022-10-31 15:33:58 +07:00
parent 4ea9b388f0
commit 820769071d
3 changed files with 12 additions and 5 deletions

View File

@@ -185,6 +185,8 @@ class AuthorList extends BaseList {
} }
async expandAuthor(item) { async expandAuthor(item) {
this.$emit('listEvent', {action: 'ignoreScroll'});
const expanded = _.cloneDeep(this.expandedAuthor); const expanded = _.cloneDeep(this.expandedAuthor);
const key = item.author; const key = item.author;
@@ -197,7 +199,6 @@ class AuthorList extends BaseList {
expanded.shift(); expanded.shift();
} }
//this.$emit('listEvent', {action: 'ignoreScroll'});
this.setSetting('expandedAuthor', expanded); this.setSetting('expandedAuthor', expanded);
} else { } else {
const i = expanded.indexOf(key); const i = expanded.indexOf(key);

View File

@@ -229,6 +229,8 @@ export default class BaseList {
} }
async expandSeries(seriesItem) { async expandSeries(seriesItem) {
this.$emit('listEvent', {action: 'ignoreScroll'});
const expandedSeries = _.cloneDeep(this.expandedSeries); const expandedSeries = _.cloneDeep(this.expandedSeries);
const key = seriesItem.key; const key = seriesItem.key;
@@ -241,7 +243,6 @@ export default class BaseList {
this.getSeriesBooks(seriesItem); //no await this.getSeriesBooks(seriesItem); //no await
//this.$emit('listEvent', {action: 'ignoreScroll'});
this.setSetting('expandedSeries', expandedSeries); this.setSetting('expandedSeries', expandedSeries);
} else { } else {
const i = expandedSeries.indexOf(key); const i = expandedSeries.indexOf(key);

View File

@@ -744,11 +744,13 @@ class Search {
} }
onScroll() { onScroll() {
if (this.ignoreScrolling)
return;
const curScrollTop = this.$refs.scroller.scrollTop; const curScrollTop = this.$refs.scroller.scrollTop;
if (this.ignoreScrolling) {
this.lastScrollTop = curScrollTop;
return;
}
if (!this.lastScrollTop) if (!this.lastScrollTop)
this.lastScrollTop = 0; this.lastScrollTop = 0;
if (!this.lastScrollTop2) if (!this.lastScrollTop2)
@@ -756,6 +758,9 @@ class Search {
if (curScrollTop - this.lastScrollTop > 0) { if (curScrollTop - this.lastScrollTop > 0) {
this.$refs.toolPanel.style.position = 'relative'; 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`; this.$refs.toolPanel.style.top = `${this.lastScrollTop2}px`;
} else { } else {
this.$refs.toolPanel.style.position = 'sticky'; this.$refs.toolPanel.style.position = 'sticky';