diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 5388e3f..90fd286 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -357,9 +357,15 @@ var IPython = (function (IPython) { if (kill_kernel) { that.kernel.kill(); } - // if we are autosaving, trigger an autosave on nav-away - if (that.dirty && that.autosave_interval && ! that.read_only) { - that.save_notebook(); + // if we are autosaving, trigger an autosave on nav-away. + // still warn, because if we don't the autosave may fail. + 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 // pop up the "don't leave" dialog.