Merge pull request #2921 from minrk/undo-cell-menu

add menu item for undo delete cell
pull/37/head
Bussonnier Matthias 13 years ago
commit a6ec75a96b

@ -83,6 +83,9 @@ var IPython = (function (IPython) {
this.element.find('#delete_cell').click(function () {
IPython.notebook.delete_cell();
});
this.element.find('#undelete_cell').click(function () {
IPython.notebook.undelete();
});
this.element.find('#split_cell').click(function () {
IPython.notebook.split_cell();
});

@ -546,6 +546,7 @@ var IPython = (function (IPython) {
var i = this.index_or_selected(index);
var cell = this.get_selected_cell();
this.undelete_backup = cell.toJSON();
$('#undelete_cell').removeClass('ui-state-disabled');
if (this.is_valid_cell_index(i)) {
var ce = this.get_cell_element(i);
ce.remove();
@ -866,6 +867,7 @@ var IPython = (function (IPython) {
this.undelete_backup = null;
this.undelete_index = null;
}
$('#undelete_cell').addClass('ui-state-disabled');
}
// Split/merge

@ -77,7 +77,8 @@ class="notebook_app"
<li id="paste_cell_above" class="ui-state-disabled"><a href="#">Paste Cell Above</a></li>
<li id="paste_cell_below" class="ui-state-disabled"><a href="#">Paste Cell Below</a></li>
<li id="paste_cell_replace" class="ui-state-disabled"><a href="#">Paste Cell &amp; Replace</a></li>
<li id="delete_cell"><a href="#">Delete</a></li>
<li id="delete_cell"><a href="#">Delete Cell</a></li>
<li id="undelete_cell" class="ui-state-disabled"><a href="#">Undo Delete Cell</a></li>
<hr/>
<li id="split_cell"><a href="#">Split Cell</a></li>
<li id="merge_cell_above"><a href="#">Merge Cell Above</a></li>

Loading…
Cancel
Save