Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions IPython/frontend/html/notebook/static/js/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,24 @@ var IPython = (function (IPython) {
}
};

/**
* Show/Hide CodeMirror LineNumber
* @method show_line_numbers
*
* @param value {Bool} show (true), or hide (false) the line number in CodeMirror
**/
Cell.prototype.show_line_numbers = function (value) {
this.code_mirror.setOption('lineNumbers', value);
this.code_mirror.refresh();
};

/**
* Toggle CodeMirror LineNumber
* @method toggle_line_numbers
**/
Cell.prototype.toggle_line_numbers = function () {
if (this.code_mirror.getOption('lineNumbers') == false) {
this.code_mirror.setOption('lineNumbers', true);
} else {
this.code_mirror.setOption('lineNumbers', false);
}
this.code_mirror.refresh();
var val = this.code_mirror.getOption('lineNumbers');
this.show_line_numbers(!val);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion IPython/frontend/html/notebook/static/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var IPython = (function (IPython) {
* {
* label:'my button',
* icon:'ui-icon-disk',
* callback:function(){alert('hoho'),
* callback:function(){alert('hoho')},
* id : 'my_button_id', // this is optional
* },
* {
Expand Down