##// END OF EJS Templates
Removing old autogrow JS code.
Brian E. Granger -
Show More
@@ -227,29 +227,6 b' var IPython = (function (IPython) {'
227 227 return text;
228 228 };
229 229
230
231 /** Grow the cell by hand. This is used upon reloading from JSON, when the
232 * autogrow handler is not called.
233 *
234 * could be made static
235 *
236 * @param {Dom element} - element
237 * @method grow
238 **/
239 Cell.prototype.grow = function(element) {
240 var dom = element.get(0);
241 var lines_count = 0;
242 // modified split rule from
243 // http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
244 var lines = dom.value.split(/\r|\r\n|\n/);
245 lines_count = lines.length;
246 if (lines_count >= 1) {
247 dom.rows = lines_count;
248 } else {
249 dom.rows = 1;
250 }
251 };
252
253 230 /**
254 231 * Show/Hide CodeMirror LineNumber
255 232 * @method show_line_numbers
@@ -225,22 +225,6 b' IPython.utils = (function (IPython) {'
225 225 "$1<a target=\"_blank\" href=\"$2$3\">$2$3</a>");
226 226 }
227 227
228 grow = function(element) {
229 // Grow the cell by hand. This is used upon reloading from JSON, when the
230 // autogrow handler is not called.
231 var dom = element.get(0);
232 var lines_count = 0;
233 // modified split rule from
234 // http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
235 var lines = dom.value.split(/\r|\r\n|\n/);
236 lines_count = lines.length;
237 if (lines_count >= 1) {
238 dom.rows = lines_count;
239 } else {
240 dom.rows = 1;
241 }
242 };
243
244 228 // some keycodes that seem to be platform/browser independant
245 229 var keycodes ={
246 230 BACKSPACE: 8,
@@ -297,7 +281,6 b' IPython.utils = (function (IPython) {'
297 281 uuid : uuid,
298 282 fixConsole : fixConsole,
299 283 keycodes : keycodes,
300 grow : grow,
301 284 fixCarriageReturn : fixCarriageReturn,
302 285 autoLinkUrls : autoLinkUrls,
303 286 points_to_pixels : points_to_pixels,
General Comments 0
You need to be logged in to leave comments. Login now