From bcc02b1935c367db49d57856eccf5152a91b6c45 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 9 Oct 2020 19:21:03 +0200 Subject: deploy new back-button navigation for train details --- public/static/js/collapse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'public/static/js/collapse.js') diff --git a/public/static/js/collapse.js b/public/static/js/collapse.js index 1f835c5..817d120 100644 --- a/public/static/js/collapse.js +++ b/public/static/js/collapse.js @@ -16,7 +16,6 @@ function dbf_reg_handlers() { const moreinfo = trainElem.data('moreinfo').split('|'); const this_href = window.location.href; const station = $('div.app').data('station'); - // TODO get station name... history.pushState({'page':'traindetail','train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + station); $('.moreinfo').each(function() { var infoElem = $(this); @@ -122,7 +121,6 @@ $(function() { history.replaceState({'page':'station'}, document.title, ''); } window.onpopstate = function(event) { - console.log('pop ' + document.location + ' ' + JSON.stringify(event.state)); if ((event.state != null) && (event.state['page'] == 'station')) { $('.moreinfo').each(function() { $(this).removeClass('expanded-moreinfo'); @@ -132,6 +130,8 @@ $(function() { $('div.app').append(''); reload_app(); } + } else { + console.log("unhandled popstate! " + document.location); } }; }); -- cgit v1.2.3