mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Merge pull request #1334 from fawce/keycuts
Make Control-S (or Cmd-S on Apple) save the actual notebook instead of bringing up the useless 'save as html' dialog. This doesn't disable the C-m-s keybinding, simply adds the far more familiar and common C-s.
This commit is contained in:
commit
5067e77292
@ -83,6 +83,7 @@ var IPython = (function (IPython) {
|
||||
that.remove_and_cancel_tooltip();
|
||||
}
|
||||
|
||||
|
||||
if (event.keyCode === 13 && (event.shiftKey || event.ctrlKey)) {
|
||||
// Always ignore shift-enter in CodeMirror as we handle it.
|
||||
return true;
|
||||
|
@ -62,7 +62,14 @@ var IPython = (function (IPython) {
|
||||
$(document).keydown(function (event) {
|
||||
// console.log(event);
|
||||
if (that.read_only) return true;
|
||||
if (event.which === 27) {
|
||||
|
||||
// Save (CTRL+S) or (AppleKey+S)
|
||||
//metaKey = applekey on mac
|
||||
if ((event.ctrlKey || event.metaKey) && event.keyCode==83) {
|
||||
IPython.save_widget.save_notebook();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
} else if (event.which === 27) {
|
||||
// Intercept escape at highest level to avoid closing
|
||||
// websocket connection with firefox
|
||||
event.preventDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user