Use synchronous request for creating new notebooks

To get round popup blockers
This commit is contained in:
Thomas Kluyver 2014-11-03 15:29:09 -08:00
parent 2a497c16eb
commit b7a558d5b9
3 changed files with 5 additions and 0 deletions

View File

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

View File

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

View File

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