Specify toggle value on cell line number#2903
Conversation
There was a problem hiding this comment.
Just to be clear, if this sets an explicit value, it's not toggling anymore.
There was a problem hiding this comment.
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.
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