mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Merge pull request #6416 from Carreau/foobarcode
Unify Text/CodeCell code.
This commit is contained in:
commit
63a7969123
@ -157,6 +157,16 @@ define([
|
||||
that.events.trigger('command_mode.Cell', {cell: that});
|
||||
});
|
||||
}
|
||||
|
||||
this.element.dblclick(function () {
|
||||
if (that.selected === false) {
|
||||
this.events.trigger('select.Cell', {'cell':that});
|
||||
}
|
||||
var cont = that.unrender();
|
||||
if (cont) {
|
||||
that.focus_editor();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -288,6 +288,7 @@ define([
|
||||
delete CodeCell.msg_cells[old_msg_id];
|
||||
}
|
||||
CodeCell.msg_cells[this.last_msg_id] = this;
|
||||
this.render();
|
||||
};
|
||||
|
||||
/**
|
||||
@ -360,11 +361,6 @@ define([
|
||||
return cont;
|
||||
};
|
||||
|
||||
CodeCell.prototype.unrender = function () {
|
||||
// CodeCell is always rendered
|
||||
return false;
|
||||
};
|
||||
|
||||
CodeCell.prototype.select_all = function () {
|
||||
var start = {line: 0, ch: 0};
|
||||
var nlines = this.code_mirror.lineCount();
|
||||
|
@ -92,27 +92,6 @@ define([
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Bind the DOM evet to cell actions
|
||||
* Need to be called after TextCell.create_element
|
||||
* @private
|
||||
* @method bind_event
|
||||
*/
|
||||
TextCell.prototype.bind_events = function () {
|
||||
Cell.prototype.bind_events.apply(this);
|
||||
var that = this;
|
||||
|
||||
this.element.dblclick(function () {
|
||||
if (that.selected === false) {
|
||||
this.events.trigger('select.Cell', {'cell':that});
|
||||
}
|
||||
var cont = that.unrender();
|
||||
if (cont) {
|
||||
that.focus_editor();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Cell level actions
|
||||
|
||||
TextCell.prototype.select = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user