Show More
@@ -1073,6 +1073,7 var IPython = (function (IPython) { | |||||
1073 | Notebook.prototype.merge_cell_above = function () { |
|
1073 | Notebook.prototype.merge_cell_above = function () { | |
1074 | var index = this.get_selected_index(); |
|
1074 | var index = this.get_selected_index(); | |
1075 | var cell = this.get_cell(index); |
|
1075 | var cell = this.get_cell(index); | |
|
1076 | var render = cell.rendered; | |||
1076 | if (!cell.is_mergeable()) { |
|
1077 | if (!cell.is_mergeable()) { | |
1077 | return; |
|
1078 | return; | |
1078 | } |
|
1079 | } | |
@@ -1086,9 +1087,13 var IPython = (function (IPython) { | |||||
1086 | if (cell instanceof IPython.CodeCell) { |
|
1087 | if (cell instanceof IPython.CodeCell) { | |
1087 | cell.set_text(upper_text+'\n'+text); |
|
1088 | cell.set_text(upper_text+'\n'+text); | |
1088 | } else if (cell instanceof IPython.MarkdownCell) { |
|
1089 | } else if (cell instanceof IPython.MarkdownCell) { | |
1089 | cell.unrender(); |
|
1090 | cell.unrender(); // Must unrender before we set_text. | |
1090 | cell.set_text(upper_text+'\n\n'+text); |
|
1091 | cell.set_text(upper_text+'\n\n'+text); | |
1091 |
|
|
1092 | if (render) { | |
|
1093 | // The rendered state of the final cell should match | |||
|
1094 | // that of the original selected cell; | |||
|
1095 | cell.render(); | |||
|
1096 | } | |||
1092 | }; |
|
1097 | }; | |
1093 | this.delete_cell(index-1); |
|
1098 | this.delete_cell(index-1); | |
1094 | this.select(this.find_cell_index(cell)); |
|
1099 | this.select(this.find_cell_index(cell)); | |
@@ -1103,6 +1108,7 var IPython = (function (IPython) { | |||||
1103 | Notebook.prototype.merge_cell_below = function () { |
|
1108 | Notebook.prototype.merge_cell_below = function () { | |
1104 | var index = this.get_selected_index(); |
|
1109 | var index = this.get_selected_index(); | |
1105 | var cell = this.get_cell(index); |
|
1110 | var cell = this.get_cell(index); | |
|
1111 | var render = cell.rendered; | |||
1106 | if (!cell.is_mergeable()) { |
|
1112 | if (!cell.is_mergeable()) { | |
1107 | return; |
|
1113 | return; | |
1108 | } |
|
1114 | } | |
@@ -1116,9 +1122,13 var IPython = (function (IPython) { | |||||
1116 | if (cell instanceof IPython.CodeCell) { |
|
1122 | if (cell instanceof IPython.CodeCell) { | |
1117 | cell.set_text(text+'\n'+lower_text); |
|
1123 | cell.set_text(text+'\n'+lower_text); | |
1118 | } else if (cell instanceof IPython.MarkdownCell) { |
|
1124 | } else if (cell instanceof IPython.MarkdownCell) { | |
1119 | cell.unrender(); |
|
1125 | cell.unrender(); // Must unrender before we set_text. | |
1120 | cell.set_text(text+'\n\n'+lower_text); |
|
1126 | cell.set_text(text+'\n\n'+lower_text); | |
1121 |
|
|
1127 | if (render) { | |
|
1128 | // The rendered state of the final cell should match | |||
|
1129 | // that of the original selected cell; | |||
|
1130 | cell.render(); | |||
|
1131 | } | |||
1122 | }; |
|
1132 | }; | |
1123 | this.delete_cell(index+1); |
|
1133 | this.delete_cell(index+1); | |
1124 | this.select(this.find_cell_index(cell)); |
|
1134 | this.select(this.find_cell_index(cell)); |
General Comments 0
You need to be logged in to leave comments.
Login now