mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
Better way of saving through CodeMirror
This should support whatever keyboard shortcuts are configured for the 'save' command.
This commit is contained in:
parent
8dced9ab73
commit
d567331d4d
@ -21,6 +21,11 @@ function($,
|
||||
|
||||
this.codemirror = CodeMirror($(this.selector)[0]);
|
||||
|
||||
// It appears we have to set commands on the CodeMirror class, not the
|
||||
// instance. I'd like to be wrong, but since there should only be one CM
|
||||
// instance on the page, this is good enough for now.
|
||||
CodeMirror.commands.save = $.proxy(this.save, this);
|
||||
|
||||
this.save_enabled = false;
|
||||
};
|
||||
|
||||
@ -46,9 +51,6 @@ function($,
|
||||
that.save_enabled = false;
|
||||
}
|
||||
);
|
||||
cm.setOption("extraKeys", {
|
||||
"Ctrl-S": $.proxy(this.save, this),
|
||||
});
|
||||
};
|
||||
|
||||
Editor.prototype.save = function() {
|
||||
|
Loading…
Reference in New Issue
Block a user