Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
added keyboard shortcut for toggling the right pane, closes #4552
zadam6b58e59819ad
diff --git a/src/public/app/widgets/containers/right_pane_container.js b/src/public/app/widgets/containers/right_pane_container.jsindex 123f2416c3..c62ea9ca65 100644--- a/src/public/app/widgets/containers/right_pane_container.js+++ b/src/public/app/widgets/containers/right_pane_container.js@@ -8,10 +8,13 @@ export default class RightPaneContainer extends FlexContainer {this.id('right-pane');this.css('height', '100%');this.collapsible();++ this.rightPaneHidden = false;}isEnabled() {return super.isEnabled()+ && !this.rightPaneHidden&& this.children.length > 0&& !!this.children.find(ch => ch.isEnabled() && ch.canBeShown());}@@ -44,4 +47,10 @@ export default class RightPaneContainer extends FlexContainer {splitService.setupRightPaneResizer();}}++ toggleRightPaneEvent() {+ this.rightPaneHidden = !this.rightPaneHidden;++ this.reEvaluateRightPaneVisibilityCommand();+ }}diff --git a/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js b/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.jsindex c52569945a..90a931ea6b 100644--- a/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js+++ b/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js@@ -18,6 +18,8 @@ const TPL = `<h5>Highlights List visibility</h5><p>You can hide the highlights widget per-note by adding a <code>#hideHighlightWidget</code> label.</p>++ <p>You can configure a keyboard shortcut for quickly toggling the right pane (including Highlights) in the Options -> Shortcuts (name "toggleRightPane").</p></div>`;export default class HighlightsListOptions extends OptionsWidget {diff --git a/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js b/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.jsindex 3795b86704..5715cb48f2 100644--- a/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js+++ b/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js@@ -11,6 +11,8 @@ const TPL = `</div><p>You can also use this option to effectively disable TOC by setting a very high number.</p>++ <p>You can configure a keyboard shortcut for quickly toggling the right pane (including TOC) in the Options -> Shortcuts (name "toggleRightPane").</p></div>`;export default class TableOfContentsOptions extends OptionsWidget {diff --git a/src/services/keyboard_actions.js b/src/services/keyboard_actions.jsindex c883373e12..694b7a1d7f 100644--- a/src/services/keyboard_actions.js+++ b/src/services/keyboard_actions.js@@ -494,9 +494,16 @@ const DEFAULT_KEYBOARD_ACTIONS = [separator: "Other"},+ {+ actionName: "toggleRightPane",+ defaultShortcuts: [],+ description: "Toggle the display of the right pane, which includes Table of Contents and Highlights",+ scope: "window"+ },{actionName: "printActiveNote",defaultShortcuts: [],+ description: "Print active note",scope: "window"},{