From 02c3714e3a369bbd77befa9be1c4a23a25a5e50e 2015-03-09 17:43:11 From: Thomas Kluyver Date: 2015-03-09 17:43:11 Subject: [PATCH] Merge pull request #8006 from minrk/save-copy trigger save before copy if there are unsaved changes. --- diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index d575852..a7990ed 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -104,6 +104,9 @@ define([ window.open(utils.url_join_encode(that.base_url, 'tree', parent), IPython._target); }); this.element.find('#copy_notebook').click(function () { + if (that.notebook.dirty) { + that.notebook.save_notebook({async : false}); + } that.notebook.copy_notebook(); return false; });