diff options
Diffstat (limited to 'app/assets/javascripts/boards')
-rw-r--r-- | app/assets/javascripts/boards/components/board_card.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/boards/components/board_sidebar.js | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/boards/components/board_card.vue b/app/assets/javascripts/boards/components/board_card.vue index 5735c8ded3d..246d3b9dcd1 100644 --- a/app/assets/javascripts/boards/components/board_card.vue +++ b/app/assets/javascripts/boards/components/board_card.vue @@ -2,6 +2,7 @@ /* eslint-disable vue/require-default-prop */ import IssueCardInner from './issue_card_inner.vue'; import eventHub from '../eventhub'; +import sidebarEventHub from '~/sidebar/event_hub'; import boardsStore from '../stores/boards_store'; export default { @@ -73,6 +74,11 @@ export default { showIssue(e) { if (e.target.classList.contains('js-no-trigger')) return; + // If no issues are opened, close all sidebars first + if (!boardsStore.detail?.issue?.id) { + sidebarEventHub.$emit('sidebar.closeAll'); + } + // If CMD or CTRL is clicked const isMultiSelect = this.canMultiSelect && (e.ctrlKey || e.metaKey); diff --git a/app/assets/javascripts/boards/components/board_sidebar.js b/app/assets/javascripts/boards/components/board_sidebar.js index a3a9753f1b5..66a5e134205 100644 --- a/app/assets/javascripts/boards/components/board_sidebar.js +++ b/app/assets/javascripts/boards/components/board_sidebar.js @@ -103,12 +103,14 @@ export default Vue.extend({ eventHub.$on('sidebar.addAssignee', this.addAssignee); eventHub.$on('sidebar.removeAllAssignees', this.removeAllAssignees); eventHub.$on('sidebar.saveAssignees', this.saveAssignees); + eventHub.$on('sidebar.closeAll', this.closeSidebar); }, beforeDestroy() { eventHub.$off('sidebar.removeAssignee', this.removeAssignee); eventHub.$off('sidebar.addAssignee', this.addAssignee); eventHub.$off('sidebar.removeAllAssignees', this.removeAllAssignees); eventHub.$off('sidebar.saveAssignees', this.saveAssignees); + eventHub.$off('sidebar.closeAll', this.closeSidebar); }, mounted() { new IssuableContext(this.currentUser); |