Skip to content

Commit 6b58e59

Browse files
committed
added keyboard shortcut for toggling the right pane, closes #4552
1 parent c6df25e commit 6b58e59

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

src/public/app/widgets/containers/right_pane_container.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ export default class RightPaneContainer extends FlexContainer {
88
this.id('right-pane');
99
this.css('height', '100%');
1010
this.collapsible();
11+
12+
this.rightPaneHidden = false;
1113
}
1214

1315
isEnabled() {
1416
return super.isEnabled()
17+
&& !this.rightPaneHidden
1518
&& this.children.length > 0
1619
&& !!this.children.find(ch => ch.isEnabled() && ch.canBeShown());
1720
}
@@ -44,4 +47,10 @@ export default class RightPaneContainer extends FlexContainer {
4447
splitService.setupRightPaneResizer();
4548
}
4649
}
50+
51+
toggleRightPaneEvent() {
52+
this.rightPaneHidden = !this.rightPaneHidden;
53+
54+
this.reEvaluateRightPaneVisibilityCommand();
55+
}
4756
}

src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const TPL = `
1818
<h5>Highlights List visibility</h5>
1919
2020
<p>You can hide the highlights widget per-note by adding a <code>#hideHighlightWidget</code> label.</p>
21+
22+
<p>You can configure a keyboard shortcut for quickly toggling the right pane (including Highlights) in the Options -> Shortcuts (name "toggleRightPane").</p>
2123
</div>`;
2224

2325
export default class HighlightsListOptions extends OptionsWidget {

src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const TPL = `
1111
</div>
1212
1313
<p>You can also use this option to effectively disable TOC by setting a very high number.</p>
14+
15+
<p>You can configure a keyboard shortcut for quickly toggling the right pane (including TOC) in the Options -> Shortcuts (name "toggleRightPane").</p>
1416
</div>`;
1517

1618
export default class TableOfContentsOptions extends OptionsWidget {

src/services/keyboard_actions.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,16 @@ const DEFAULT_KEYBOARD_ACTIONS = [
494494
separator: "Other"
495495
},
496496

497+
{
498+
actionName: "toggleRightPane",
499+
defaultShortcuts: [],
500+
description: "Toggle the display of the right pane, which includes Table of Contents and Highlights",
501+
scope: "window"
502+
},
497503
{
498504
actionName: "printActiveNote",
499505
defaultShortcuts: [],
506+
description: "Print active note",
500507
scope: "window"
501508
},
502509
{

0 commit comments

Comments
 (0)