From 6e0134772c637d7990ed738ec61546b33f2a630c Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Thu, 29 Oct 2015 16:25:01 -0700 Subject: [PATCH] 'more menu bound to actions' --- notebook/static/notebook/js/actions.js | 6 ++++++ notebook/static/notebook/js/menubar.js | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index 29ba9e424..84a1444a3 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -551,6 +551,12 @@ define(function(require){ env.notebook.copy_notebook(); } }, + 'trust-notebook':{ + help: "Trust the current notebook", + handler : function (env, event) { + env.notebook.trust_notebook(); + } + }, 'rename-notebook':{ help: "Rename current notebook", handler : function (env, event) { diff --git a/notebook/static/notebook/js/menubar.js b/notebook/static/notebook/js/menubar.js index 691c05a2c..2471be55e 100644 --- a/notebook/static/notebook/js/menubar.js +++ b/notebook/static/notebook/js/menubar.js @@ -158,14 +158,7 @@ define([ that._nbconvert('script', true); }); - this.element.find('#rename_notebook').click(function () { - that.save_widget.rename_notebook({notebook: that.notebook}); - }); - - this.element.find('#trust_notebook').click(function () { - that.notebook.trust_notebook(); - }); this.events.on('trust_changed.Notebook', function (event, trusted) { if (trusted) { that.element.find('#trust_notebook') @@ -203,6 +196,8 @@ define([ }); var id_actions_dict = { + '#trust_notebook' : 'jupyter-notebook:trust-notebook', + '#rename_notebook' : 'jupyter-notebook:rename-notebook', '#find_and_replace' : 'jupyter-notebook:find-and-replace', '#save_checkpoint': 'jupyter-notebook:save-notebook', '#restart_kernel': 'jupyter-notebook:confirm-restart-kernel',