From f39a55114913673a69a3f12b94d834b15cf7a983 Mon Sep 17 00:00:00 2001 From: Milos Miljkovic Date: Sun, 9 Apr 2017 13:09:44 -0400 Subject: [PATCH] Added show, hide, and toggle actions for menubar container to the Command Palette --- notebook/static/notebook/js/actions.js | 31 +++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index b6d120c95..5e766abb1 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -248,8 +248,8 @@ define(function(require){ help_index : 'dc', handler : function (env) { env.notebook.extend_selection_by(-1); - // scroll into view, - // do not call notebook.focus_cell(), or + // scroll into view, + // do not call notebook.focus_cell(), or // all the selection get thrown away env.notebook.get_selected_cell().element.focus(); } @@ -259,8 +259,8 @@ define(function(require){ help_index : 'dd', handler : function (env) { env.notebook.extend_selection_by(1); - // scroll into view, - // do not call notebook.focus_cell(), or + // scroll into view, + // do not call notebook.focus_cell(), or // all the selection get thrown away env.notebook.get_selected_cell().element.focus(); } @@ -443,7 +443,7 @@ define(function(require){ } }, // TODO reminder - // open an issue, merge with above merge with last cell of notebook if at top. + // open an issue, merge with above merge with last cell of notebook if at top. 'merge-cell-with-previous-cell' : { handler : function (env) { env.notebook.merge_cell_above(); @@ -545,6 +545,27 @@ define(function(require){ env.notebook.header = false; } }, + 'toggle-menubar':{ + help: 'hide/show the menu bar', + handler : function(env) { + $('#menubar-container').toggle(); + events.trigger('resize-header.Page'); + } + }, + 'show-menubar':{ + help: 'show the menu bar', + handler : function(env) { + $('#menubar-container').show(); + events.trigger('resize-header.Page'); + } + }, + 'hide-menubar':{ + help: 'hide the menu bar', + handler : function(env) { + $('#menubar-container').hide(); + events.trigger('resize-header.Page'); + } + }, 'toggle-toolbar':{ help: 'hide/show the toolbar', handler : function(env) {