summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-01-27 11:20:29 +0000
committerFatih Acet <acetfatih@gmail.com>2017-02-03 17:02:43 +0300
commitac7949db174210a84fd4d2af43652559f56dbdb9 (patch)
tree299303268d6b4c73ed56c420cb0d86527b0d9d3a
parentc4fc17f258d10ec86d0023c44126362ca8fa63c4 (diff)
downloadgitlab-ce-ac7949db174210a84fd4d2af43652559f56dbdb9.tar.gz
Fixed masonry re-triggering when it didnt need to
Fixed scroll position being lost
-rw-r--r--app/assets/javascripts/boards/components/modal/list.js.es610
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/boards/components/modal/list.js.es6 b/app/assets/javascripts/boards/components/modal/list.js.es6
index 6a681d9278f..4ef40f851d4 100644
--- a/app/assets/javascripts/boards/components/modal/list.js.es6
+++ b/app/assets/javascripts/boards/components/modal/list.js.es6
@@ -14,8 +14,10 @@
this.initMasonry();
},
issues: {
- handler() {
- this.initMasonry();
+ handler(issues, oldIssues) {
+ if (this.activeTab === 'selected' || issues.length !== oldIssues.length) {
+ this.initMasonry();
+ }
},
deep: true,
},
@@ -37,11 +39,15 @@
return issue.selected;
},
initMasonry() {
+ const listScrollTop = this.$refs.list.scrollTop;
+
this.$nextTick(() => {
this.destroyMasonry();
listMasonry = new Masonry(this.$refs.list, {
transitionDuration: 0,
});
+
+ this.$refs.list.scrollTop = listScrollTop;
});
},
destroyMasonry() {