-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoggle_menu.js
32 lines (26 loc) · 1.22 KB
/
toggle_menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var events = require('base/js/events');
Jupyter.keyboard_manager.command_shortcuts.add_shortcut('Alt-h', {
help : 'toggle header',
help_index : 'zz', // last position
handler : function (event) {
$('div#header-container').toggle(); // Jupyter logo, notebook title
$('.header-bar').toggle(); // div separating header and menu bar
// Adjust the height of the notebook inside the window
// Jupyter.menubar._size_header(); // deprecated
events.trigger('resize-header.Page');
}
});
Jupyter.keyboard_manager.command_shortcuts.add_shortcut('Alt-m', {
help : 'toggle menu bar',
help_index : 'zz', // last position
handler : function (event) {
$('div#menubar-container').toggle(); // contains the menu bar and the toolbar
// To toggle them individually:
// $('div#menubar').toggle(); // toggles only the menu bar
// $('div#maintoolbar').toggle(); // toggles only the toolbar
// Adjust the height of the notebook inside the window
// Jupyter.menubar._size_header(); // deprecated
events.trigger('resize-header.Page');
}
});
console.log("Custom shortcuts to toggle the menu bar and toolbar loaded successfully!");