From a89e800e188e3827797cfe83a8b9f5df86fcd84a Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 9 Mar 2015 09:50:17 -0700 Subject: [PATCH] trigger save before copy if there are unsaved changes. just like we do before downloading --- IPython/html/static/notebook/js/menubar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index d5758527e..a7990ed80 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; });