Do not leave toolbar element focused.

Can lead to enter re-trigerring them
(ok, can be a feature sometimes I guess)

closes #7475
This commit is contained in:
Bussonnier Matthias 2015-01-15 12:10:24 +01:00
parent e8492d2d53
commit 4021e9d487
2 changed files with 8 additions and 0 deletions

View File

@ -102,7 +102,10 @@ define(function(require){
icon: 'fa-cut',
help_index : 'ee',
handler : function (env) {
var index = env.notebook.get_selected_index();
env.notebook.cut_cell();
env.notebook.select(index);
env.notebook.focus_cell();
}
},
'copy-selected-cell' : {
@ -110,6 +113,7 @@ define(function(require){
help_index : 'ef',
handler : function (env) {
env.notebook.copy_cell();
env.notebook.focus_cell();
}
},
'paste-cell-before' : {
@ -257,6 +261,7 @@ define(function(require){
help_index : 'ha',
handler : function (env) {
env.notebook.kernel.interrupt();
env.notebook.focus_cell();
}
},
'restart-kernel':{
@ -264,6 +269,7 @@ define(function(require){
help_index : 'hb',
handler : function (env) {
env.notebook.restart_kernel();
env.notebook.focus_cell();
}
},
'undo-last-cell-deletion' : {

View File

@ -101,6 +101,7 @@ define([
default:
console.log("unrecognized cell type:", cell_type);
}
that.notebook.focus_cell();
});
return sel;
@ -123,6 +124,7 @@ define([
celltoolbar.CellToolbar.activate_preset(val, that.events);
that.notebook.metadata.celltoolbar = val;
}
that.notebook.focus_cell();
});
// Setup the currently registered presets.
var presets = celltoolbar.CellToolbar.list_presets();