##// END OF EJS Templates
add delay to autosave in beforeunload...
MinRK -
Show More
@@ -368,7 +368,15 b' var IPython = (function (IPython) {'
368 // still warn, because if we don't the autosave may fail.
368 // still warn, because if we don't the autosave may fail.
369 if (that.dirty && ! that.read_only) {
369 if (that.dirty && ! that.read_only) {
370 if ( that.autosave_interval ) {
370 if ( that.autosave_interval ) {
371 that.save_notebook();
371 // schedule autosave in a timeout
372 // this gives you a chance to forcefully discard changes
373 // by reloading the page if you *really* want to.
374 // the timer doesn't start until you *dismiss* the dialog.
375 setTimeout(function () {
376 if (that.dirty) {
377 that.save_notebook();
378 }
379 }, 1000);
372 return "Autosave in progress, latest changes may be lost.";
380 return "Autosave in progress, latest changes may be lost.";
373 } else {
381 } else {
374 return "Unsaved changes will be lost.";
382 return "Unsaved changes will be lost.";
General Comments 0
You need to be logged in to leave comments. Login now