Commit ac7949db authored by Phil Hughes's avatar Phil Hughes Committed by Fatih Acet

Fixed masonry re-triggering when it didnt need to

Fixed scroll position being lost
parent c4fc17f2
...@@ -14,8 +14,10 @@ ...@@ -14,8 +14,10 @@
this.initMasonry(); this.initMasonry();
}, },
issues: { issues: {
handler() { handler(issues, oldIssues) {
if (this.activeTab === 'selected' || issues.length !== oldIssues.length) {
this.initMasonry(); this.initMasonry();
}
}, },
deep: true, deep: true,
}, },
...@@ -37,11 +39,15 @@ ...@@ -37,11 +39,15 @@
return issue.selected; return issue.selected;
}, },
initMasonry() { initMasonry() {
const listScrollTop = this.$refs.list.scrollTop;
this.$nextTick(() => { this.$nextTick(() => {
this.destroyMasonry(); this.destroyMasonry();
listMasonry = new Masonry(this.$refs.list, { listMasonry = new Masonry(this.$refs.list, {
transitionDuration: 0, transitionDuration: 0,
}); });
this.$refs.list.scrollTop = listScrollTop;
}); });
}, },
destroyMasonry() { destroyMasonry() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment