From d1462f115f46fdce36fe189b72d340ae31d687f3 2014-11-04 17:53:17 From: Thomas Kluyver Date: 2014-11-04 17:53:17 Subject: [PATCH] Make a window immediately, and set its location on response Avoids the need for async:false --- diff --git a/IPython/html/static/tree/js/terminallist.js b/IPython/html/static/tree/js/terminallist.js index 625b6d0..720883d 100644 --- a/IPython/html/static/tree/js/terminallist.js +++ b/IPython/html/static/tree/js/terminallist.js @@ -40,19 +40,14 @@ define([ }; TerminalList.prototype.new_terminal = function () { + var w = window.open(); + var base_url = this.base_url; var settings = { type : "POST", - cache : false, - async : false, + dataType: "json", success : function (data, status, xhr) { var name = data.name; - window.open( - utils.url_join_encode( - this.base_url, - 'terminals', - name), - '_blank' - ); + w.location = utils.url_join_encode(base_url, 'terminals', name); }, error : utils.log_ajax_error, };