##// END OF EJS Templates
Merge pull request #4916 from ellisonbg/modalbehavior...
Min RK -
r14962:3e91d885 merge
parent child Browse files
Show More
@@ -88,18 +88,18 b' var IPython = (function (IPython) {'
88 88 }
89 89 },
90 90 'shift+enter' : {
91 help : 'run cell',
91 help : 'run cell, select below',
92 92 help_index : 'ba',
93 93 handler : function (event) {
94 IPython.notebook.execute_cell();
94 IPython.notebook.execute_cell_and_select_below();
95 95 return false;
96 96 }
97 97 },
98 98 'ctrl+enter' : {
99 help : 'run cell, select below',
99 help : 'run cell',
100 100 help_index : 'bb',
101 101 handler : function (event) {
102 IPython.notebook.execute_cell_and_select_below();
102 IPython.notebook.execute_cell();
103 103 return false;
104 104 }
105 105 },
@@ -847,7 +847,6 b' var IPython = (function (IPython) {'
847 847 target_cell.code_mirror.clearHistory();
848 848 source_element.remove();
849 849 this.select(i);
850 this.edit_mode();
851 850 this.set_dirty(true);
852 851 };
853 852 };
@@ -878,7 +877,9 b' var IPython = (function (IPython) {'
878 877 target_cell.code_mirror.clearHistory();
879 878 source_element.remove();
880 879 this.select(i);
881 this.edit_mode();
880 if ((source_cell instanceof IPython.TextCell) && source_cell.rendered) {
881 target_cell.render();
882 }
882 883 this.set_dirty(true);
883 884 };
884 885 };
@@ -910,7 +911,6 b' var IPython = (function (IPython) {'
910 911 target_cell.code_mirror.clearHistory();
911 912 source_element.remove();
912 913 this.select(i);
913 this.edit_mode();
914 914 this.set_dirty(true);
915 915 };
916 916 };
@@ -947,8 +947,10 b' var IPython = (function (IPython) {'
947 947 target_cell.code_mirror.clearHistory();
948 948 source_element.remove();
949 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 954 this.set_dirty(true);
953 955 $([IPython.events]).trigger('selected_cell_type_changed.Notebook',
954 956 {'cell_type':'heading',level:level}
@@ -1441,11 +1443,7 b' var IPython = (function (IPython) {'
1441 1443 return;
1442 1444 }
1443 1445
1444 // Only insert a new cell, if we ended up in an already populated cell
1445 var next_text = this.get_cell(cell_index+1).get_text();
1446 if (/\S/.test(next_text) === true) {
1447 1446 this.insert_cell_below('code');
1448 }
1449 1447 this.select(cell_index+1);
1450 1448 this.edit_mode();
1451 1449 this.set_dirty(true);
@@ -22,7 +22,7 b' casper.notebook_test(function () {'
22 22 var cell = IPython.notebook.get_cell(0);
23 23 cell.set_text('a=11; print(a)');
24 24 cell.clear_output();
25 IPython.utils.press_ctrl_enter();
25 IPython.utils.press_shift_enter();
26 26 });
27 27
28 28 this.wait_for_output(0);
@@ -31,7 +31,7 b' casper.notebook_test(function () {'
31 31 var result = this.get_output_cell(0);
32 32 var num_cells = this.get_cells_length();
33 33 this.test.assertEquals(result.text, '11\n', 'cell execute (using ctrl-enter)');
34 this.test.assertEquals(num_cells, 2, 'ctrl-enter adds a new cell at the bottom')
34 this.test.assertEquals(num_cells, 2, 'shift-enter adds a new cell at the bottom')
35 35 });
36 36
37 37 // do it again with the keyboard shortcut
@@ -41,7 +41,7 b' casper.notebook_test(function () {'
41 41 var cell = IPython.notebook.get_cell(0);
42 42 cell.set_text('a=12; print(a)');
43 43 cell.clear_output();
44 IPython.utils.press_shift_enter();
44 IPython.utils.press_ctrl_enter();
45 45 });
46 46
47 47 this.wait_for_output(0);
@@ -50,7 +50,7 b' casper.notebook_test(function () {'
50 50 var result = this.get_output_cell(0);
51 51 var num_cells = this.get_cells_length();
52 52 this.test.assertEquals(result.text, '12\n', 'cell execute (using shift-enter)');
53 this.test.assertEquals(num_cells, 1, 'shift-enter adds no new cell at the bottom')
53 this.test.assertEquals(num_cells, 1, 'ctrl-enter adds no new cell at the bottom')
54 54 });
55 55
56 56 // press the "play" triangle button in the toolbar
General Comments 0
You need to be logged in to leave comments. Login now