mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
Use _new_window
method for "Download as .ipynb"
This commit is contained in:
parent
e9c9c3a10e
commit
f0ee02fb27
@ -172,16 +172,15 @@ define([
|
|||||||
this.element.find('#download_ipynb').click(function () {
|
this.element.find('#download_ipynb').click(function () {
|
||||||
var base_url = that.notebook.base_url;
|
var base_url = that.notebook.base_url;
|
||||||
var notebook_path = utils.encode_uri_components(that.notebook.notebook_path);
|
var notebook_path = utils.encode_uri_components(that.notebook.notebook_path);
|
||||||
var w = window.open('');
|
|
||||||
var url = utils.url_path_join(
|
var url = utils.url_path_join(
|
||||||
base_url, 'files', notebook_path
|
base_url, 'files', notebook_path
|
||||||
) + '?download=1';
|
) + '?download=1';
|
||||||
if (that.notebook.dirty && that.notebook.writable) {
|
if (that.notebook.dirty && that.notebook.writable) {
|
||||||
that.notebook.save_notebook().then(function() {
|
that.notebook.save_notebook().then(function() {
|
||||||
w.location = url;
|
that._new_window(url);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
w.location = url;
|
that._new_window(url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user