# HG changeset patch # User Alexandre Segura # Date 1487878059 -3600 # Node ID b38ee6c486ce1832de2b1fbf74e638e2466dc26f # Parent 8fbeda6e3d988f0e9d72557801b3172643e4355e Make browser history work. diff -r 8fbeda6e3d98 -r b38ee6c486ce src/iconolab/templates/iconolab/detail_image.html --- a/src/iconolab/templates/iconolab/detail_image.html Fri Feb 24 16:17:50 2017 +0100 +++ b/src/iconolab/templates/iconolab/detail_image.html Thu Feb 23 20:27:39 2017 +0100 @@ -161,17 +161,19 @@ }, 600); } - function router () { + function router (scroll) { var url = location.hash.slice(1); if (url.length) { var annotation = url; var $el = $('.list-group a[data-annotation-id="'+annotation+'"]'); displayAnnotation($el); - scrollTo($el.closest('.panel'), $el); + if (scroll) { + scrollTo($el.closest('.panel'), $el);  + } } } - // window.addEventListener('hashchange', router); - window.addEventListener('load', router); + window.addEventListener('hashchange', function() { router(false) }); + window.addEventListener('load', function() { router(true) }); {% endblock %}