From 3184facb4b497bc44e5b5d54f0ce0fa5a4d88d3b Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 3 Apr 2024 15:07:13 +0200 Subject: do not treat hafas=0 as "HAFAS enabled" --- public/static/js/collapse.js | 4 ++-- public/static/js/geostop.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'public/static') diff --git a/public/static/js/collapse.js b/public/static/js/collapse.js index 2db1089..d7d1e3b 100644 --- a/public/static/js/collapse.js +++ b/public/static/js/collapse.js @@ -113,7 +113,7 @@ function dbf_reg_handlers() { if (param.get('detailed')) { suffix += '&detailed=1'; } - if (param.get('hafas')) { + if (param.get('hafas') && param.get('hafas') != '0') { suffix += '&hafas=' + param.get('hafas') + '&highlight=' + trainElem.data('station'); } if (param.get('past')) { @@ -122,7 +122,7 @@ function dbf_reg_handlers() { if (param.get('rt') || param.get('show_realtime')) { suffix += '&rt=1'; } - if (param.get('hafas')) { + if (param.get('hafas') && param.get('hafas') != '0') { history.pushState({'page':'traindetail','jid':trainElem.data('jid')}, 'test', '/z/' + trainElem.data('jid') + suffix); } else { history.pushState({'page':'traindetail','station':station,'train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + trainElem.data('station') + suffix); diff --git a/public/static/js/geostop.js b/public/static/js/geostop.js index 00699ec..fa2d6f1 100644 --- a/public/static/js/geostop.js +++ b/public/static/js/geostop.js @@ -42,7 +42,11 @@ $(function() { hafas = candidate.hafas; const stationlink = $(document.createElement('a')); - stationlink.attr('href', eva + '?hafas=' + hafas); + if (hafas) { + stationlink.attr('href', eva + '?hafas=' + hafas); + } else { + stationlink.attr('href', eva); + } stationlink.text(name + ' '); const distancenode = $(document.createElement('div')); -- cgit v1.2.3