mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-18 14:10:26 +08:00
Use synchronous request for creating new notebooks
To get round popup blockers
This commit is contained in:
parent
2a497c16eb
commit
b7a558d5b9
@ -91,6 +91,7 @@ define([
|
||||
// notebook's path.
|
||||
that.contents.new(that.notebook.notebook_path, null, {
|
||||
ext: ".ipynb",
|
||||
extra_settings: {async: false}, // So we can open a new window afterwards
|
||||
success: function (data) {
|
||||
window.open(
|
||||
utils.url_join_encode(
|
||||
|
@ -118,6 +118,9 @@ define([
|
||||
success : options.success || function() {},
|
||||
error : this.create_basic_error_handler(options.error)
|
||||
};
|
||||
if (options.extra_settings) {
|
||||
$.extend(settings, options.extra_settings);
|
||||
}
|
||||
$.ajax(this.api_url(path), settings);
|
||||
};
|
||||
|
||||
|
@ -62,6 +62,7 @@ require([
|
||||
$('#new_notebook').click(function (e) {
|
||||
contents.new(common_options.notebook_path, null, {
|
||||
ext: ".ipynb",
|
||||
extra_settings: {async: false}, // So we can open a new window afterwards
|
||||
success: function (data) {
|
||||
window.open(
|
||||
utils.url_join_encode(
|
||||
|
Loading…
x
Reference in New Issue
Block a user