diff --git a/notebook/static/notebook/js/menubar.js b/notebook/static/notebook/js/menubar.js index 02ffcd318..a53ecaf81 100644 --- a/notebook/static/notebook/js/menubar.js +++ b/notebook/static/notebook/js/menubar.js @@ -113,12 +113,16 @@ define([ this.element.find('#download_ipynb').click(function () { var base_url = that.notebook.base_url; var notebook_path = that.notebook.notebook_path; + var w = window.open(''); + var url = utils.url_join_encode(base_url, 'files', notebook_path) + + '?download=1'; if (that.notebook.dirty) { - that.notebook.save_notebook({async : false}); + that.notebook.save_notebook().then(function() { + w.location = url; + }); + } else { + w.location = url; } - - var url = utils.url_join_encode(base_url, 'files', notebook_path); - window.open(url + '?download=1'); }); this.element.find('#print_preview').click(function () {