summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/boards/components/board_list.vue15
-rw-r--r--app/assets/javascripts/boards/components/board_list_deprecated.vue7
2 files changed, 18 insertions, 4 deletions
diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue
index d9dc0025658..b58600fa058 100644
--- a/app/assets/javascripts/boards/components/board_list.vue
+++ b/app/assets/javascripts/boards/components/board_list.vue
@@ -111,10 +111,17 @@ export default {
this.showCount = this.scrollHeight() > Math.ceil(this.listHeight());
});
},
- },
- created() {
- eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
- eventHub.$on(`scroll-board-list-${this.list.id}`, this.scrollToTop);
+ 'list.id': {
+ handler(id, oldVal) {
+ if (id) {
+ eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
+ eventHub.$on(`scroll-board-list-${this.list.id}`, this.scrollToTop);
+ eventHub.$off(`toggle-issue-form-${oldVal}`, this.toggleForm);
+ eventHub.$off(`scroll-board-list-${oldVal}`, this.scrollToTop);
+ }
+ },
+ immediate: true,
+ },
},
beforeDestroy() {
eventHub.$off(`toggle-issue-form-${this.list.id}`, this.toggleForm);
diff --git a/app/assets/javascripts/boards/components/board_list_deprecated.vue b/app/assets/javascripts/boards/components/board_list_deprecated.vue
index c9ced425c1d..9b3e7e1547d 100644
--- a/app/assets/javascripts/boards/components/board_list_deprecated.vue
+++ b/app/assets/javascripts/boards/components/board_list_deprecated.vue
@@ -91,6 +91,13 @@ export default {
}
});
},
+ 'list.id': {
+ handler(id) {
+ if (id) {
+ eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
+ }
+ },
+ },
},
created() {
eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);