summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-02-03 14:48:31 +0000
committerPhil Hughes <me@iamphill.com>2017-02-03 14:48:31 +0000
commitfee064be01e6e37076b9af4028ade12a2ce0180a (patch)
treeb841b30cabe61365143b9b286891136bcb8cedb6 /app
parent8c5e50e12b72ca4a80dab02534739bde6e5a9eb5 (diff)
downloadgitlab-ce-fee064be01e6e37076b9af4028ade12a2ce0180a.tar.gz
Fixed modal lists dropdown not updating when list is deletedadd-issues-to-boards
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/boards/boards_bundle.js.es64
-rw-r--r--app/assets/javascripts/boards/components/modal/lists_dropdown.js.es65
-rw-r--r--app/assets/javascripts/boards/stores/modal_store.js.es62
3 files changed, 5 insertions, 6 deletions
diff --git a/app/assets/javascripts/boards/boards_bundle.js.es6 b/app/assets/javascripts/boards/boards_bundle.js.es6
index 4ac91786762..529ea9aec5b 100644
--- a/app/assets/javascripts/boards/boards_bundle.js.es6
+++ b/app/assets/javascripts/boards/boards_bundle.js.es6
@@ -71,10 +71,6 @@ $(() => {
Store.addBlankState();
this.loading = false;
-
- if (this.state.lists.length > 0) {
- ModalStore.store.selectedList = this.state.lists[0];
- }
});
}
});
diff --git a/app/assets/javascripts/boards/components/modal/lists_dropdown.js.es6 b/app/assets/javascripts/boards/components/modal/lists_dropdown.js.es6
index 96f12da3753..3c05120a2da 100644
--- a/app/assets/javascripts/boards/components/modal/lists_dropdown.js.es6
+++ b/app/assets/javascripts/boards/components/modal/lists_dropdown.js.es6
@@ -11,9 +11,12 @@
},
computed: {
selected() {
- return this.modal.selectedList;
+ return this.modal.selectedList || this.state.lists[0];
},
},
+ destroyed() {
+ this.modal.selectedList = null;
+ },
template: `
<div class="dropdown inline">
<button
diff --git a/app/assets/javascripts/boards/stores/modal_store.js.es6 b/app/assets/javascripts/boards/stores/modal_store.js.es6
index fa46b6135e0..73518b42b84 100644
--- a/app/assets/javascripts/boards/stores/modal_store.js.es6
+++ b/app/assets/javascripts/boards/stores/modal_store.js.es6
@@ -11,7 +11,7 @@
selectedIssues: [],
showAddIssuesModal: false,
activeTab: 'all',
- selectedList: {},
+ selectedList: null,
searchTerm: '',
loading: false,
loadingNewPage: false,