mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Merge pull request #3478 from minrk/rewarn
restore "unsaved changes" warning on unload
This commit is contained in:
commit
202dec41e6
@ -357,9 +357,15 @@ var IPython = (function (IPython) {
|
|||||||
if (kill_kernel) {
|
if (kill_kernel) {
|
||||||
that.kernel.kill();
|
that.kernel.kill();
|
||||||
}
|
}
|
||||||
// if we are autosaving, trigger an autosave on nav-away
|
// if we are autosaving, trigger an autosave on nav-away.
|
||||||
if (that.dirty && that.autosave_interval && ! that.read_only) {
|
// still warn, because if we don't the autosave may fail.
|
||||||
that.save_notebook();
|
if (that.dirty && ! that.read_only) {
|
||||||
|
if ( that.autosave_interval ) {
|
||||||
|
that.save_notebook();
|
||||||
|
return "Autosave in progress, latest changes may be lost.";
|
||||||
|
} else {
|
||||||
|
return "Unsaved changes will be lost.";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// Null is the *only* return value that will make the browser not
|
// Null is the *only* return value that will make the browser not
|
||||||
// pop up the "don't leave" dialog.
|
// pop up the "don't leave" dialog.
|
||||||
|
Loading…
Reference in New Issue
Block a user