From c0c0a21e07d1002d39c74885f82b08b653fca3f0 2013-03-23 19:46:03 From: MinRK Date: 2013-03-23 19:46:03 Subject: [PATCH] trigger hash on notebook load enables direct links to anchors within notebooks --- diff --git a/IPython/frontend/html/notebook/static/js/notebookmain.js b/IPython/frontend/html/notebook/static/js/notebookmain.js index 297822d..64ffd95 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'));