From a83e8ff91a997e74b0060b8fa29e9a35aafd5d57 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Mon, 11 Sep 2023 18:03:49 -0400 Subject: [PATCH] Switch back to window scope --- src/public/app/widgets/tab_row.js | 6 +++--- src/services/keyboard_actions.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js index 07c581056..4172052d5 100644 --- a/src/public/app/widgets/tab_row.js +++ b/src/public/app/widgets/tab_row.js @@ -268,11 +268,11 @@ export default class TabRowWidget extends BasicWidget { }); }); - keyboardActionService.setupActionsForElement('tabs', $(document), this); + keyboardActionService.setupActionsForElement('window', $(document), this); } goToTab(tabNumber) { - const index = tabNumber === 0 ? this.tabEls.length - 1 : tabNumber - 1; + const index = tabNumber === Number.POSITIVE_INFINITY ? this.tabEls.length - 1 : tabNumber - 1; const tab = this.tabEls[index]; if (!tab) return; appContext.tabManager.activateNoteContext(tab.getAttribute('data-ntx-id')); @@ -287,7 +287,7 @@ export default class TabRowWidget extends BasicWidget { seventhTabCommand() {this.goToTab(7);} eigthTabCommand() {this.goToTab(8);} ninthTabCommand() {this.goToTab(9);} - lastTabCommand() {this.goToTab(0);} + lastTabCommand() {this.goToTab(Number.POSITIVE_INFINITY);} setupStyle() { this.$style = $("