Show More
@@ -107,7 +107,6 b' define(function(require){' | |||||
107 | var index = env.notebook.get_selected_index(); |
|
107 | var index = env.notebook.get_selected_index(); | |
108 | env.notebook.cut_cell(); |
|
108 | env.notebook.cut_cell(); | |
109 | env.notebook.select(index); |
|
109 | env.notebook.select(index); | |
110 | env.notebook.focus_cell(); |
|
|||
111 | } |
|
110 | } | |
112 | }, |
|
111 | }, | |
113 | 'copy-selected-cell' : { |
|
112 | 'copy-selected-cell' : { | |
@@ -115,7 +114,6 b' define(function(require){' | |||||
115 | help_index : 'ef', |
|
114 | help_index : 'ef', | |
116 | handler : function (env) { |
|
115 | handler : function (env) { | |
117 | env.notebook.copy_cell(); |
|
116 | env.notebook.copy_cell(); | |
118 | env.notebook.focus_cell(); |
|
|||
119 | } |
|
117 | } | |
120 | }, |
|
118 | }, | |
121 | 'paste-cell-before' : { |
|
119 | 'paste-cell-before' : { | |
@@ -268,7 +266,6 b' define(function(require){' | |||||
268 | help_index : 'ha', |
|
266 | help_index : 'ha', | |
269 | handler : function (env) { |
|
267 | handler : function (env) { | |
270 | env.notebook.kernel.interrupt(); |
|
268 | env.notebook.kernel.interrupt(); | |
271 | env.notebook.focus_cell(); |
|
|||
272 | } |
|
269 | } | |
273 | }, |
|
270 | }, | |
274 | 'restart-kernel':{ |
|
271 | 'restart-kernel':{ | |
@@ -276,7 +273,6 b' define(function(require){' | |||||
276 | help_index : 'hb', |
|
273 | help_index : 'hb', | |
277 | handler : function (env) { |
|
274 | handler : function (env) { | |
278 | env.notebook.restart_kernel(); |
|
275 | env.notebook.restart_kernel(); | |
279 | env.notebook.focus_cell(); |
|
|||
280 | } |
|
276 | } | |
281 | }, |
|
277 | }, | |
282 | 'undo-last-cell-deletion' : { |
|
278 | 'undo-last-cell-deletion' : { | |
@@ -381,7 +377,6 b' define(function(require){' | |||||
381 | if(event){ |
|
377 | if(event){ | |
382 | event.preventDefault(); |
|
378 | event.preventDefault(); | |
383 | } |
|
379 | } | |
384 | env.notebook.ensure_focused(); |
|
|||
385 | return false; |
|
380 | return false; | |
386 | } |
|
381 | } | |
387 | }, |
|
382 | }, |
@@ -25,7 +25,6 b' define([' | |||||
25 | this.events = options.events; |
|
25 | this.events = options.events; | |
26 | this.notebook = options.notebook; |
|
26 | this.notebook = options.notebook; | |
27 | this._make(); |
|
27 | this._make(); | |
28 | this.notebook.keyboard_manager.register_events(this.element); |
|
|||
29 | Object.seal(this); |
|
28 | Object.seal(this); | |
30 | }; |
|
29 | }; | |
31 |
|
30 | |||
@@ -74,6 +73,7 b' define([' | |||||
74 | .append($('<option/>').attr('value','markdown').text('Markdown')) |
|
73 | .append($('<option/>').attr('value','markdown').text('Markdown')) | |
75 | .append($('<option/>').attr('value','raw').text('Raw NBConvert')) |
|
74 | .append($('<option/>').attr('value','raw').text('Raw NBConvert')) | |
76 | .append($('<option/>').attr('value','heading').text('Heading')); |
|
75 | .append($('<option/>').attr('value','heading').text('Heading')); | |
|
76 | this.notebook.keyboard_manager.register_events(sel); | |||
77 | this.events.on('selected_cell_type_changed.Notebook', function (event, data) { |
|
77 | this.events.on('selected_cell_type_changed.Notebook', function (event, data) { | |
78 | if (data.cell_type === 'heading') { |
|
78 | if (data.cell_type === 'heading') { | |
79 | sel.val('Markdown'); |
|
79 | sel.val('Markdown'); | |
@@ -126,6 +126,7 b' define([' | |||||
126 | } |
|
126 | } | |
127 | that.notebook.focus_cell(); |
|
127 | that.notebook.focus_cell(); | |
128 | }); |
|
128 | }); | |
|
129 | this.notebook.keyboard_manager.register_events(select); | |||
129 | // Setup the currently registered presets. |
|
130 | // Setup the currently registered presets. | |
130 | var presets = celltoolbar.CellToolbar.list_presets(); |
|
131 | var presets = celltoolbar.CellToolbar.list_presets(); | |
131 | for (var i=0; i<presets.length; i++) { |
|
132 | for (var i=0; i<presets.length; i++) { |
@@ -663,10 +663,9 b' define(function (require) {' | |||||
663 | Notebook.prototype.command_mode = function () { |
|
663 | Notebook.prototype.command_mode = function () { | |
664 | var cell = this.get_cell(this.get_edit_index()); |
|
664 | var cell = this.get_cell(this.get_edit_index()); | |
665 | if (cell && this.mode !== 'command') { |
|
665 | if (cell && this.mode !== 'command') { | |
666 |
// We don't call cell.command_mode, but rather |
|
666 | // We don't call cell.command_mode, but rather blur the CM editor | |
667 |
// which will |
|
667 | // which will trigger the call to handle_command_mode. | |
668 | // handle_command_mode. |
|
668 | cell.code_mirror.getInputField().blur(); | |
669 | cell.focus_cell(); |
|
|||
670 | } |
|
669 | } | |
671 | }; |
|
670 | }; | |
672 |
|
671 |
General Comments 0
You need to be logged in to leave comments.
Login now