Show More
@@ -240,16 +240,23 var IPython = (function (IPython) { | |||
|
240 | 240 | }; |
|
241 | 241 | |
|
242 | 242 | /** |
|
243 | * Show/Hide CodeMirror LineNumber | |
|
244 | * @method show_line_numbers | |
|
245 | * | |
|
246 | * @param value {Bool} show (true), or hide (false) the line number in CodeMirror | |
|
247 | **/ | |
|
248 | Cell.prototype.show_line_numbers = function (value) { | |
|
249 | this.code_mirror.setOption('lineNumbers', value); | |
|
250 | this.code_mirror.refresh(); | |
|
251 | }; | |
|
252 | ||
|
253 | /** | |
|
243 | 254 | * Toggle CodeMirror LineNumber |
|
244 | 255 | * @method toggle_line_numbers |
|
245 | 256 | **/ |
|
246 | 257 | Cell.prototype.toggle_line_numbers = function () { |
|
247 |
|
|
|
248 | this.code_mirror.setOption('lineNumbers', true); | |
|
249 | } else { | |
|
250 | this.code_mirror.setOption('lineNumbers', false); | |
|
251 | } | |
|
252 | this.code_mirror.refresh(); | |
|
258 | var val = this.code_mirror.getOption('lineNumbers'); | |
|
259 | this.show_line_numbers(!val); | |
|
253 | 260 | }; |
|
254 | 261 | |
|
255 | 262 | /** |
General Comments 0
You need to be logged in to leave comments.
Login now