Show More
@@ -17,6 +17,7 b' var IPython = (function (IPython) {' | |||
|
17 | 17 | var KeyboardManager = function () { |
|
18 | 18 | this.mode = 'command'; |
|
19 | 19 | this.enabled = true; |
|
20 | this.delete_count = 0; | |
|
20 | 21 | this.bind_events(); |
|
21 | 22 | }; |
|
22 | 23 | |
@@ -109,6 +110,7 b' var IPython = (function (IPython) {' | |||
|
109 | 110 | } |
|
110 | 111 | |
|
111 | 112 | KeyboardManager.prototype.handle_command_mode = function (event) { |
|
113 | var that = this; | |
|
112 | 114 | var notebook = IPython.notebook; |
|
113 | 115 | |
|
114 | 116 | if (event.which === key.ENTER && !(event.ctrlKey || event.altKey || event.shiftKey)) { |
@@ -145,7 +147,16 b' var IPython = (function (IPython) {' | |||
|
145 | 147 | return false; |
|
146 | 148 | } else if (event.which === 68) { |
|
147 | 149 | // Delete selected cell = d |
|
150 | var dc = this.delete_count; | |
|
151 | console.log('delete_count', dc); | |
|
152 | if (dc === 0) { | |
|
153 | this.delete_count = 1; | |
|
154 | setTimeout(function () { | |
|
155 | that.delete_count = 0; | |
|
156 | }, 1000); | |
|
157 | } else if (dc === 1) { | |
|
148 | 158 | notebook.delete_cell(); |
|
159 | } | |
|
149 | 160 | return false; |
|
150 | 161 | } else if (event.which === 65) { |
|
151 | 162 | // Insert code cell above selected = a |
General Comments 0
You need to be logged in to leave comments.
Login now