Show More
@@ -262,7 +262,7 b' var IPython = (function (IPython) {' | |||||
262 | /** |
|
262 | /** | |
263 | * Check if this cell's unfocus event was legit. |
|
263 | * Check if this cell's unfocus event was legit. | |
264 | */ |
|
264 | */ | |
265 |
Cell.prototype.should_cancel_ |
|
265 | Cell.prototype.should_cancel_blur = function () { | |
266 | return false; |
|
266 | return false; | |
267 | }; |
|
267 | }; | |
268 |
|
268 |
@@ -421,10 +421,10 b' var IPython = (function (IPython) {' | |||||
421 | /** |
|
421 | /** | |
422 | * Check if this cell's unfocus event was legit. |
|
422 | * Check if this cell's unfocus event was legit. | |
423 | */ |
|
423 | */ | |
424 |
CodeCell.prototype.should_cancel_ |
|
424 | CodeCell.prototype.should_cancel_blur = function () { | |
425 | // Cancel this unfocus event if the base wants to cancel or the cell |
|
425 | // Cancel this unfocus event if the base wants to cancel or the cell | |
426 | // completer is open. |
|
426 | // completer is open. | |
427 |
return IPython.Cell.prototype.should_cancel_ |
|
427 | return IPython.Cell.prototype.should_cancel_blur.apply(this) || | |
428 | (this.completer && this.completer.is_visible()); |
|
428 | (this.completer && this.completer.is_visible()); | |
429 | }; |
|
429 | }; | |
430 |
|
430 |
@@ -575,20 +575,20 b' var IPython = (function (IPython) {' | |||||
575 | console.log('notebook.handle_cell_text_blur', cell); |
|
575 | console.log('notebook.handle_cell_text_blur', cell); | |
576 |
|
576 | |||
577 | // Check if this unfocus event is legit. |
|
577 | // Check if this unfocus event is legit. | |
578 |
if (!this.should_cancel_ |
|
578 | if (!this.should_cancel_blur(cell)) { | |
579 | this.command_mode(); |
|
579 | this.command_mode(); | |
580 | } |
|
580 | } | |
581 | }; |
|
581 | }; | |
582 |
|
582 | |||
583 |
Notebook.prototype.should_cancel_ |
|
583 | Notebook.prototype.should_cancel_blur = function (cell) { | |
584 | // Determine whether or not the unfocus event should be aknowledged. |
|
584 | // Determine whether or not the unfocus event should be aknowledged. | |
585 |
|
585 | |||
586 | // If the tooltip is visible, ignore the unfocus. |
|
586 | // If the tooltip is visible, ignore the unfocus. | |
587 | var tooltip_visible = IPython.tooltip && IPython.tooltip.is_visible(); |
|
587 | var tooltip_visible = IPython.tooltip && IPython.tooltip.is_visible(); | |
588 | if (tooltip_visible) { return true; } |
|
588 | if (tooltip_visible) { return true; } | |
589 |
|
589 | |||
590 |
// Check the cell's should_cancel_ |
|
590 | // Check the cell's should_cancel_blur method. | |
591 |
return (cell.should_cancel_ |
|
591 | return (cell.should_cancel_blur !== undefined && cell.should_cancel_blur()); | |
592 | }; |
|
592 | }; | |
593 |
|
593 | |||
594 | // Cell movement |
|
594 | // Cell movement |
General Comments 0
You need to be logged in to leave comments.
Login now