##// END OF EJS Templates
fix up and down arrows in the top and bottom cells
Paul Ivanov -
Show More
@@ -100,9 +100,8 b' var IPython = (function (IPython) {'
100 help_index : '',
100 help_index : '',
101 handler : function (event) {
101 handler : function (event) {
102 var index = IPython.notebook.get_selected_index();
102 var index = IPython.notebook.get_selected_index();
103 if (index !== null && index !== 0) {
104 var cell = IPython.notebook.get_cell(index);
103 var cell = IPython.notebook.get_cell(index);
105 if (cell && cell.at_top()) {
104 if (cell && cell.at_top() && index !== 0) {
106 event.preventDefault();
105 event.preventDefault();
107 IPython.notebook.command_mode();
106 IPython.notebook.command_mode();
108 IPython.notebook.select_prev();
107 IPython.notebook.select_prev();
@@ -118,16 +117,14 b' var IPython = (function (IPython) {'
118 return false;
117 return false;
119 }
118 }
120 }
119 }
121 }
122 },
120 },
123 'down' : {
121 'down' : {
124 help : '',
122 help : '',
125 help_index : '',
123 help_index : '',
126 handler : function (event) {
124 handler : function (event) {
127 var index = IPython.notebook.get_selected_index();
125 var index = IPython.notebook.get_selected_index();
128 if (index !== null && index !== (IPython.notebook.ncells()-1)) {
129 var cell = IPython.notebook.get_cell(index);
126 var cell = IPython.notebook.get_cell(index);
130 if (cell && cell.at_bottom()) {
127 if (cell.at_bottom() && index !== (IPython.notebook.ncells()-1)) {
131 event.preventDefault();
128 event.preventDefault();
132 IPython.notebook.command_mode();
129 IPython.notebook.command_mode();
133 IPython.notebook.select_next();
130 IPython.notebook.select_next();
@@ -135,7 +132,7 b' var IPython = (function (IPython) {'
135 var cm = IPython.notebook.get_selected_cell().code_mirror;
132 var cm = IPython.notebook.get_selected_cell().code_mirror;
136 cm.setCursor(0, 0);
133 cm.setCursor(0, 0);
137 return false;
134 return false;
138 } else if (cell) {
135 } else {
139 var cm = cell.code_mirror;
136 var cm = cell.code_mirror;
140 var cursor = cm.getCursor();
137 var cursor = cm.getCursor();
141 cursor.line += 1;
138 cursor.line += 1;
@@ -143,7 +140,6 b' var IPython = (function (IPython) {'
143 return false;
140 return false;
144 }
141 }
145 }
142 }
146 }
147 },
143 },
148 'alt+-' : {
144 'alt+-' : {
149 help : 'split cell',
145 help : 'split cell',
General Comments 0
You need to be logged in to leave comments. Login now