Fix asyncy nbconvert to download

Thomas Kluyver 12 years ago
parent 800e2ad25a
commit 58b0669b9b

@ -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 () {

@ -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);

Loading…
Cancel
Save