From 43c5163f6662e862c7b19b016869963b732dd207 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 8 Jan 2023 13:58:51 +0100 Subject: [PATCH] renamed closing commands --- src/public/app/components/tab_manager.js | 8 ++++++-- src/public/app/widgets/tab_row.js | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/public/app/components/tab_manager.js b/src/public/app/components/tab_manager.js index 5c71ed558..b84c2fcd3 100644 --- a/src/public/app/components/tab_manager.js +++ b/src/public/app/components/tab_manager.js @@ -477,13 +477,13 @@ export default class TabManager extends Component { this.openAndActivateEmptyTab(); } - async removeAllTabsCommand() { + async closeAllTabsCommand() { for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) { await this.removeNoteContext(ntxIdToRemove); } } - async removeAllTabsExceptForThisCommand({ntxId}) { + async closeOtherTabsCommand({ntxId}) { for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) { if (ntxIdToRemove !== ntxId) { await this.removeNoteContext(ntxIdToRemove); @@ -491,6 +491,10 @@ export default class TabManager extends Component { } } + async closeTabCommand({ntxId}) { + await this.removeNoteContext(ntxId); + } + async moveTabToNewWindowCommand({ntxId}) { const {notePath, hoistedNoteId} = this.getNoteContextById(ntxId); diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js index a401157fc..41249650a 100644 --- a/src/public/app/widgets/tab_row.js +++ b/src/public/app/widgets/tab_row.js @@ -262,9 +262,10 @@ export default class TabRowWidget extends BasicWidget { x: e.pageX, y: e.pageY, items: [ - {title: "Move this tab to a new window", command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"}, - {title: "Close all tabs", command: "removeAllTabs", uiIcon: "bx bx-x"}, - {title: "Close all tabs except for this", command: "removeAllTabsExceptForThis", uiIcon: "bx bx-x"}, + {title: "Close", command: "closeTab", uiIcon: "bx bx-x"}, + {title: "Close other tabs", command: "closeOtherTabs", uiIcon: "bx bx-x"}, + {title: "Close all tabs", command: "closeAllTabs", uiIcon: "bx bx-x"}, + {title: "Move this tab to a new window", command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"} ], selectMenuItemHandler: ({command}) => { this.triggerCommand(command, {ntxId});