From 0f6870df13362a6af5d95a0fddd970559acb42bd Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 22 Nov 2020 19:52:13 +0100 Subject: Fix train detail view for split stations Was broken when the train's station did not match the requested one --- 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 0d4652b..0418678 100644 --- a/public/static/js/collapse.js +++ b/public/static/js/collapse.js @@ -1,6 +1,6 @@ function reload_app() { // TODO use a variable instead of window.location.href, as - // window.locatin.href may be /z/... + // window.location.href may be /z/... // Until then, we guard it by only reloading whin moreinfo is not expanded. if ($('.expanded-moreinfo').length == 0) { $.get(window.location.href, {ajax: 1}, function(data) { @@ -88,7 +88,7 @@ function dbf_reg_handlers() { $('div.app > ul > li').click(function() { const trainElem = $(this); const station = $('div.app').data('station'); - history.pushState({'page':'traindetail','station':station,'train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + station); + history.pushState({'page':'traindetail','station':station,'train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + trainElem.data('station')); dbf_show_moreinfo(trainElem, false); }); } -- cgit v1.2.3