##// END OF EJS Templates
Don't enter edit mode when changing cell type and preserve renderd.
Brian E. Granger -
Show More
@@ -847,7 +847,6 b' var IPython = (function (IPython) {'
847 target_cell.code_mirror.clearHistory();
847 target_cell.code_mirror.clearHistory();
848 source_element.remove();
848 source_element.remove();
849 this.select(i);
849 this.select(i);
850 this.edit_mode();
851 this.set_dirty(true);
850 this.set_dirty(true);
852 };
851 };
853 };
852 };
@@ -878,7 +877,9 b' var IPython = (function (IPython) {'
878 target_cell.code_mirror.clearHistory();
877 target_cell.code_mirror.clearHistory();
879 source_element.remove();
878 source_element.remove();
880 this.select(i);
879 this.select(i);
881 this.edit_mode();
880 if ((source_cell instanceof IPython.TextCell) && source_cell.rendered) {
881 target_cell.render();
882 }
882 this.set_dirty(true);
883 this.set_dirty(true);
883 };
884 };
884 };
885 };
@@ -910,7 +911,6 b' var IPython = (function (IPython) {'
910 target_cell.code_mirror.clearHistory();
911 target_cell.code_mirror.clearHistory();
911 source_element.remove();
912 source_element.remove();
912 this.select(i);
913 this.select(i);
913 this.edit_mode();
914 this.set_dirty(true);
914 this.set_dirty(true);
915 };
915 };
916 };
916 };
@@ -947,8 +947,10 b' var IPython = (function (IPython) {'
947 target_cell.code_mirror.clearHistory();
947 target_cell.code_mirror.clearHistory();
948 source_element.remove();
948 source_element.remove();
949 this.select(i);
949 this.select(i);
950 if ((source_cell instanceof IPython.TextCell) && source_cell.rendered) {
951 target_cell.render();
952 }
950 };
953 };
951 this.edit_mode();
952 this.set_dirty(true);
954 this.set_dirty(true);
953 $([IPython.events]).trigger('selected_cell_type_changed.Notebook',
955 $([IPython.events]).trigger('selected_cell_type_changed.Notebook',
954 {'cell_type':'heading',level:level}
956 {'cell_type':'heading',level:level}
General Comments 0
You need to be logged in to leave comments. Login now