diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js
index 5348445..8350fc2 100644
--- a/IPython/html/static/notebook/js/menubar.js
+++ b/IPython/html/static/notebook/js/menubar.js
@@ -69,17 +69,21 @@ define([
MenuBar.prototype._nbconvert = function (format, download) {
download = download || false;
var notebook_path = this.notebook.notebook_path;
- if (this.notebook.dirty) {
- this.notebook.save_notebook({async : false});
- }
var url = utils.url_join_encode(
this.base_url,
'nbconvert',
format,
notebook_path
) + "?download=" + download.toString();
-
- window.open(url);
+
+ var w = window.open()
+ if (this.notebook.dirty) {
+ this.notebook.save_notebook().then(function() {
+ w.location = url;
+ });
+ } else {
+ w.location = url;
+ }
};
MenuBar.prototype.bind_events = function () {
diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js
index 5bd4315..f68af2d 100644
--- a/IPython/html/static/notebook/js/notebook.js
+++ b/IPython/html/static/notebook/js/notebook.js
@@ -1922,7 +1922,7 @@ define([
var start = new Date().getTime();
var that = this;
- this.contents.save(this.notebook_path, model).then(
+ return this.contents.save(this.notebook_path, model).then(
$.proxy(this.save_notebook_success, this, start),
function (error) {
that.events.trigger('notebook_save_failed.Notebook', error);