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
Specify toggle value on cell line number #2903
Conversation
this.code_mirror.refresh(); | ||
return | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, if this sets an explicit value, it's not toggling anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it "toggles" only when called without argument. I have no strong
feeling about a different name if you prefere.
Le 10 févr. 2013 00:42, "Min RK" notifications@github.com a écrit :
In IPython/frontend/html/notebook/static/js/cell.js:
**/
- Cell.prototype.toggle_line_numbers = function () {
- Cell.prototype.toggle_line_numbers = function (value) {
if(value != undefined){
this.code_mirror.setOption('lineNumbers', value);
this.code_mirror.refresh();
return
}
Just to be clear, if this sets an explicit value, it's not toggling
anymore.—
Reply to this email directly or view it on GitHubhttps://github.com//pull/2903/files#r2954147..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a show_line_numbers
method for the argument, so that toggling and explicit setting are separate
mostly convenience methods to wrap codemirror one, plus doc and 1 doc fix (missing curly bracket)
Done. |
Should toggle_line_numbers call show_line_numbers? I know it's just a two-line function, so maybe it doesn't make sense. |
Done. |
Specify toggle value on cell line number
Specify toggle value on cell line number
this allow to call toggle_line_number by specyfying wether you want to
show or hide the line number with a boolean.
Without parameter it continue to toggle to the opposite of curent state