From d821ea4095e0c0efc936fa5b0ac6f317b40d3fd3 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 25 Feb 2020 12:32:21 +0100 Subject: [PATCH] fix closing all tabs except current --- src/public/javascripts/services/tab_manager.js | 4 ++-- src/public/javascripts/widgets/type_widgets/empty.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/public/javascripts/services/tab_manager.js b/src/public/javascripts/services/tab_manager.js index 16b921cc2..3049429fe 100644 --- a/src/public/javascripts/services/tab_manager.js +++ b/src/public/javascripts/services/tab_manager.js @@ -227,8 +227,8 @@ export default class TabManager extends Component { if (this.tabContexts.length <= 1) { this.openAndActivateEmptyTab(); } - else { - this.activateNextTabEvent(); + else if (tabContextToRemove.isActive()) { + this.activateNextTabCommand(); } this.children = this.children.filter(tc => tc.tabId !== tabId); diff --git a/src/public/javascripts/widgets/type_widgets/empty.js b/src/public/javascripts/widgets/type_widgets/empty.js index b166b0527..e6df0effa 100644 --- a/src/public/javascripts/widgets/type_widgets/empty.js +++ b/src/public/javascripts/widgets/type_widgets/empty.js @@ -31,11 +31,14 @@ export default class EmptyTypeWidget extends TypeWidget { }); noteAutocompleteService.showRecentNotes(this.$autoComplete); - this.$autoComplete.trigger('focus'); return this.$widget; } + doRefresh(note) { + this.$autoComplete.trigger('focus'); + } + getContent() {} focus() {}