Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing old autogrow JS code. #3234

Merged
merged 1 commit into from
Apr 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 0 additions & 23 deletions IPython/frontend/html/notebook/static/js/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,29 +227,6 @@ var IPython = (function (IPython) {
return text;
};


/** Grow the cell by hand. This is used upon reloading from JSON, when the
* autogrow handler is not called.
*
* could be made static
*
* @param {Dom element} - element
* @method grow
**/
Cell.prototype.grow = function(element) {
var dom = element.get(0);
var lines_count = 0;
// modified split rule from
// http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
var lines = dom.value.split(/\r|\r\n|\n/);
lines_count = lines.length;
if (lines_count >= 1) {
dom.rows = lines_count;
} else {
dom.rows = 1;
}
};

/**
* Show/Hide CodeMirror LineNumber
* @method show_line_numbers
Expand Down
17 changes: 0 additions & 17 deletions IPython/frontend/html/notebook/static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,6 @@ IPython.utils = (function (IPython) {
"$1<a target=\"_blank\" href=\"$2$3\">$2$3</a>");
}

grow = function(element) {
// Grow the cell by hand. This is used upon reloading from JSON, when the
// autogrow handler is not called.
var dom = element.get(0);
var lines_count = 0;
// modified split rule from
// http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
var lines = dom.value.split(/\r|\r\n|\n/);
lines_count = lines.length;
if (lines_count >= 1) {
dom.rows = lines_count;
} else {
dom.rows = 1;
}
};

// some keycodes that seem to be platform/browser independant
var keycodes ={
BACKSPACE: 8,
Expand Down Expand Up @@ -297,7 +281,6 @@ IPython.utils = (function (IPython) {
uuid : uuid,
fixConsole : fixConsole,
keycodes : keycodes,
grow : grow,
fixCarriageReturn : fixCarriageReturn,
autoLinkUrls : autoLinkUrls,
points_to_pixels : points_to_pixels,
Expand Down