Remove all should cancel blur logic.

Jonathan Frederic 12 years ago
parent 989ae4e1b3
commit 65732920eb

@ -146,10 +146,7 @@ var IPython = (function (IPython) {
}
if (this.code_mirror) {
this.code_mirror.on('blur', function(cm, change) {
// Check if this unfocus event is legit.
if (!that.should_cancel_blur()) {
$([IPython.events]).trigger('command_mode.Cell', {cell: that});
}
$([IPython.events]).trigger('command_mode.Cell', {cell: that});
});
}
};
@ -260,18 +257,7 @@ var IPython = (function (IPython) {
return false;
}
};
/**
* Determine whether or not the unfocus event should be aknowledged.
*
* @method should_cancel_blur
*
* @return results {bool} Whether or not to ignore the cell's blur event.
**/
Cell.prototype.should_cancel_blur = function () {
return false;
};
/**
* Focus the cell in the DOM sense
* @method focus_cell

@ -402,21 +402,6 @@ var IPython = (function (IPython) {
return false;
};
/**
* Determine whether or not the unfocus event should be aknowledged.
*
* @method should_cancel_blur
*
* @return results {bool} Whether or not to ignore the cell's blur event.
**/
CodeCell.prototype.should_cancel_blur = function () {
// Cancel this unfocus event if the base wants to cancel or the cell
// completer is open or the tooltip is open.
return IPython.Cell.prototype.should_cancel_blur.apply(this) ||
(this.completer && this.completer.was_shown()) ||
(IPython.tooltip && IPython.tooltip.was_shown());
};
CodeCell.prototype.select_all = function () {
var start = {line: 0, ch: 0};
var nlines = this.code_mirror.lineCount();

@ -74,7 +74,6 @@ var IPython = (function (IPython) {
var Completer = function (cell) {
this._visible = false;
this._shown = false;
this.cell = cell;
this.editor = cell.code_mirror;
var that = this;
@ -91,13 +90,6 @@ var IPython = (function (IPython) {
return this._visible;
};
Completer.prototype.was_shown = function () {
// Return whether or not the completer was shown.
var ret = this._shown;
this._shown = false;
return ret;
};
Completer.prototype.startCompletion = function () {
// call for a 'first' completion, that will set the editor and do some
// special behaviour like autopicking if only one completion availlable
@ -239,7 +231,6 @@ var IPython = (function (IPython) {
.attr('size', Math.min(10, this.raw_result.length));
this.complete.append(this.sel);
this._visible = true;
this._shown = true;
$('body').append(this.complete);
// After everything is on the page, compute the postion.
@ -298,7 +289,6 @@ var IPython = (function (IPython) {
Completer.prototype.close = function () {
this._visible = false;
this._shown = false;
if (this.done) return;
this.done = true;
$('.completions').remove();

@ -30,7 +30,6 @@ var IPython = (function (IPython) {
// handle to html
this.tooltip = $('#tooltip');
this._hidden = true;
this._shown = false;
// variable for consecutive call
this._old_cell = null;
@ -129,10 +128,6 @@ var IPython = (function (IPython) {
return !this._hidden;
};
Tooltip.prototype.was_shown = function () {
return this._shown;
};
Tooltip.prototype.showInPager = function (cell) {
// reexecute last call in pager by appending ? to show back in pager
var that = this;
@ -161,7 +156,6 @@ var IPython = (function (IPython) {
// and reset it's status
Tooltip.prototype._hide = function () {
this._hidden = true;
this._shown = false;
this.tooltip.fadeOut('fast');
$('#expanbutton').show('slow');
this.text.removeClass('bigtooltip');
@ -376,7 +370,6 @@ var IPython = (function (IPython) {
}
this._hidden = false;
this._show = true;
this.tooltip.fadeIn('fast');
this.text.children().remove();

Loading…
Cancel
Save