##// END OF EJS Templates
Fix asyncy nbconvert to download
Thomas Kluyver -
Show More
@@ -69,17 +69,21 b' define(['
69 69 MenuBar.prototype._nbconvert = function (format, download) {
70 70 download = download || false;
71 71 var notebook_path = this.notebook.notebook_path;
72 if (this.notebook.dirty) {
73 this.notebook.save_notebook({async : false});
74 }
75 72 var url = utils.url_join_encode(
76 73 this.base_url,
77 74 'nbconvert',
78 75 format,
79 76 notebook_path
80 77 ) + "?download=" + download.toString();
81
82 window.open(url);
78
79 var w = window.open()
80 if (this.notebook.dirty) {
81 this.notebook.save_notebook().then(function() {
82 w.location = url;
83 });
84 } else {
85 w.location = url;
86 }
83 87 };
84 88
85 89 MenuBar.prototype.bind_events = function () {
@@ -1922,7 +1922,7 b' define(['
1922 1922 var start = new Date().getTime();
1923 1923
1924 1924 var that = this;
1925 this.contents.save(this.notebook_path, model).then(
1925 return this.contents.save(this.notebook_path, model).then(
1926 1926 $.proxy(this.save_notebook_success, this, start),
1927 1927 function (error) {
1928 1928 that.events.trigger('notebook_save_failed.Notebook', error);
General Comments 0
You need to be logged in to leave comments. Login now