##// END OF EJS Templates
Removing old autogrow JS code.
Brian E. Granger -
Show More
@@ -227,29 +227,6 b' var IPython = (function (IPython) {'
227 return text;
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 * Show/Hide CodeMirror LineNumber
231 * Show/Hide CodeMirror LineNumber
255 * @method show_line_numbers
232 * @method show_line_numbers
@@ -225,22 +225,6 b' IPython.utils = (function (IPython) {'
225 "$1<a target=\"_blank\" href=\"$2$3\">$2$3</a>");
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 // some keycodes that seem to be platform/browser independant
228 // some keycodes that seem to be platform/browser independant
245 var keycodes ={
229 var keycodes ={
246 BACKSPACE: 8,
230 BACKSPACE: 8,
@@ -297,7 +281,6 b' IPython.utils = (function (IPython) {'
297 uuid : uuid,
281 uuid : uuid,
298 fixConsole : fixConsole,
282 fixConsole : fixConsole,
299 keycodes : keycodes,
283 keycodes : keycodes,
300 grow : grow,
301 fixCarriageReturn : fixCarriageReturn,
284 fixCarriageReturn : fixCarriageReturn,
302 autoLinkUrls : autoLinkUrls,
285 autoLinkUrls : autoLinkUrls,
303 points_to_pixels : points_to_pixels,
286 points_to_pixels : points_to_pixels,
General Comments 0
You need to be logged in to leave comments. Login now