From 7e6b5d98c7d04a5da0d247ef3bc7db01c0bfc772 Mon Sep 17 00:00:00 2001 From: MinRK Date: Sat, 23 Mar 2013 12:46:03 -0700 Subject: [PATCH] trigger hash on notebook load enables direct links to anchors within notebooks --- IPython/frontend/html/notebook/static/js/notebookmain.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IPython/frontend/html/notebook/static/js/notebookmain.js b/IPython/frontend/html/notebook/static/js/notebookmain.js index 297822dba..64ffd9508 100644 --- a/IPython/frontend/html/notebook/static/js/notebookmain.js +++ b/IPython/frontend/html/notebook/static/js/notebookmain.js @@ -82,6 +82,11 @@ $(document).ready(function () { IPython.layout_manager.do_resize(); $([IPython.events]).on('notebook_loaded.Notebook', function () { IPython.layout_manager.do_resize(); + var hash = document.location.hash; + if (hash) { + document.location.hash = ''; + document.location.hash = hash; + } }); IPython.notebook.load_notebook($('body').data('notebookId'));