##// END OF EJS Templates
Merge pull request #2903 from Carreau/toggle-line-number...
Bussonnier Matthias -
r9698:48c19e7b merge
parent child Browse files
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 if (this.code_mirror.getOption('lineNumbers') == false) {
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 /**
@@ -40,7 +40,7 var IPython = (function (IPython) {
40 40 * {
41 41 * label:'my button',
42 42 * icon:'ui-icon-disk',
43 * callback:function(){alert('hoho'),
43 * callback:function(){alert('hoho')},
44 44 * id : 'my_button_id', // this is optional
45 45 * },
46 46 * {
General Comments 0
You need to be logged in to leave comments. Login now