Show More
@@ -146,10 +146,7 b' var IPython = (function (IPython) {' | |||
|
146 | 146 | } |
|
147 | 147 | if (this.code_mirror) { |
|
148 | 148 | this.code_mirror.on('blur', function(cm, change) { |
|
149 | // Check if this unfocus event is legit. | |
|
150 | if (!that.should_cancel_blur()) { | |
|
151 | $([IPython.events]).trigger('command_mode.Cell', {cell: that}); | |
|
152 | } | |
|
149 | $([IPython.events]).trigger('command_mode.Cell', {cell: that}); | |
|
153 | 150 | }); |
|
154 | 151 | } |
|
155 | 152 | }; |
@@ -260,18 +257,7 b' var IPython = (function (IPython) {' | |||
|
260 | 257 | return false; |
|
261 | 258 | } |
|
262 | 259 | }; |
|
263 | ||
|
264 | /** | |
|
265 | * Determine whether or not the unfocus event should be aknowledged. | |
|
266 | * | |
|
267 | * @method should_cancel_blur | |
|
268 | * | |
|
269 | * @return results {bool} Whether or not to ignore the cell's blur event. | |
|
270 | **/ | |
|
271 | Cell.prototype.should_cancel_blur = function () { | |
|
272 | return false; | |
|
273 | }; | |
|
274 | ||
|
260 | ||
|
275 | 261 | /** |
|
276 | 262 | * Focus the cell in the DOM sense |
|
277 | 263 | * @method focus_cell |
@@ -402,21 +402,6 b' var IPython = (function (IPython) {' | |||
|
402 | 402 | return false; |
|
403 | 403 | }; |
|
404 | 404 | |
|
405 | /** | |
|
406 | * Determine whether or not the unfocus event should be aknowledged. | |
|
407 | * | |
|
408 | * @method should_cancel_blur | |
|
409 | * | |
|
410 | * @return results {bool} Whether or not to ignore the cell's blur event. | |
|
411 | **/ | |
|
412 | CodeCell.prototype.should_cancel_blur = function () { | |
|
413 | // Cancel this unfocus event if the base wants to cancel or the cell | |
|
414 | // completer is open or the tooltip is open. | |
|
415 | return IPython.Cell.prototype.should_cancel_blur.apply(this) || | |
|
416 | (this.completer && this.completer.was_shown()) || | |
|
417 | (IPython.tooltip && IPython.tooltip.was_shown()); | |
|
418 | }; | |
|
419 | ||
|
420 | 405 | CodeCell.prototype.select_all = function () { |
|
421 | 406 | var start = {line: 0, ch: 0}; |
|
422 | 407 | var nlines = this.code_mirror.lineCount(); |
@@ -74,7 +74,6 b' var IPython = (function (IPython) {' | |||
|
74 | 74 | |
|
75 | 75 | var Completer = function (cell) { |
|
76 | 76 | this._visible = false; |
|
77 | this._shown = false; | |
|
78 | 77 | this.cell = cell; |
|
79 | 78 | this.editor = cell.code_mirror; |
|
80 | 79 | var that = this; |
@@ -91,13 +90,6 b' var IPython = (function (IPython) {' | |||
|
91 | 90 | return this._visible; |
|
92 | 91 | }; |
|
93 | 92 | |
|
94 | Completer.prototype.was_shown = function () { | |
|
95 | // Return whether or not the completer was shown. | |
|
96 | var ret = this._shown; | |
|
97 | this._shown = false; | |
|
98 | return ret; | |
|
99 | }; | |
|
100 | ||
|
101 | 93 | Completer.prototype.startCompletion = function () { |
|
102 | 94 | // call for a 'first' completion, that will set the editor and do some |
|
103 | 95 | // special behaviour like autopicking if only one completion availlable |
@@ -239,7 +231,6 b' var IPython = (function (IPython) {' | |||
|
239 | 231 | .attr('size', Math.min(10, this.raw_result.length)); |
|
240 | 232 | this.complete.append(this.sel); |
|
241 | 233 | this._visible = true; |
|
242 | this._shown = true; | |
|
243 | 234 | $('body').append(this.complete); |
|
244 | 235 | |
|
245 | 236 | // After everything is on the page, compute the postion. |
@@ -298,7 +289,6 b' var IPython = (function (IPython) {' | |||
|
298 | 289 | |
|
299 | 290 | Completer.prototype.close = function () { |
|
300 | 291 | this._visible = false; |
|
301 | this._shown = false; | |
|
302 | 292 | if (this.done) return; |
|
303 | 293 | this.done = true; |
|
304 | 294 | $('.completions').remove(); |
@@ -30,7 +30,6 b' var IPython = (function (IPython) {' | |||
|
30 | 30 | // handle to html |
|
31 | 31 | this.tooltip = $('#tooltip'); |
|
32 | 32 | this._hidden = true; |
|
33 | this._shown = false; | |
|
34 | 33 | |
|
35 | 34 | // variable for consecutive call |
|
36 | 35 | this._old_cell = null; |
@@ -129,10 +128,6 b' var IPython = (function (IPython) {' | |||
|
129 | 128 | return !this._hidden; |
|
130 | 129 | }; |
|
131 | 130 | |
|
132 | Tooltip.prototype.was_shown = function () { | |
|
133 | return this._shown; | |
|
134 | }; | |
|
135 | ||
|
136 | 131 | Tooltip.prototype.showInPager = function (cell) { |
|
137 | 132 | // reexecute last call in pager by appending ? to show back in pager |
|
138 | 133 | var that = this; |
@@ -161,7 +156,6 b' var IPython = (function (IPython) {' | |||
|
161 | 156 | // and reset it's status |
|
162 | 157 | Tooltip.prototype._hide = function () { |
|
163 | 158 | this._hidden = true; |
|
164 | this._shown = false; | |
|
165 | 159 | this.tooltip.fadeOut('fast'); |
|
166 | 160 | $('#expanbutton').show('slow'); |
|
167 | 161 | this.text.removeClass('bigtooltip'); |
@@ -376,7 +370,6 b' var IPython = (function (IPython) {' | |||
|
376 | 370 | } |
|
377 | 371 | |
|
378 | 372 | this._hidden = false; |
|
379 | this._show = true; | |
|
380 | 373 | this.tooltip.fadeIn('fast'); |
|
381 | 374 | this.text.children().remove(); |
|
382 | 375 |
General Comments 0
You need to be logged in to leave comments.
Login now