From e5cc26485f2446c2650b12cdd65201663b3fe23a 2012-12-14 21:55:26 From: Yoav Ram Date: 2012-12-14 21:55:26 Subject: [PATCH] for downloads, replaced window.open with window.location.assign This doesn't actually open a new windows, so it's a bit nicer. Not very important, though. Source: [StackOverflow](http://stackoverflow.com/questions/1066452/easiest-way-to-open-a-download-window-without-navigating-away-from-the-page) --- diff --git a/IPython/frontend/html/notebook/static/js/menubar.js b/IPython/frontend/html/notebook/static/js/menubar.js index dc894df..0a58464 100644 --- a/IPython/frontend/html/notebook/static/js/menubar.js +++ b/IPython/frontend/html/notebook/static/js/menubar.js @@ -58,13 +58,13 @@ var IPython = (function (IPython) { var notebook_id = IPython.notebook.get_notebook_id(); var url = $('body').data('baseProjectUrl') + 'notebooks/' + notebook_id + '?format=json'; - window.open(url,'_newtab'); + window.location.assign(url); }); this.element.find('#download_py').click(function () { var notebook_id = IPython.notebook.get_notebook_id(); var url = $('body').data('baseProjectUrl') + 'notebooks/' + notebook_id + '?format=py'; - window.open(url,'_newtab'); + window.location.assign(url); }); this.element.find('button#print_notebook').click(function () { IPython.print_widget.print_notebook();