diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-03 15:07:13 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-03 15:07:13 +0200 |
commit | 3184facb4b497bc44e5b5d54f0ce0fa5a4d88d3b (patch) | |
tree | 55a9e1fc951444351b8d80008b11312642a34794 | |
parent | b7fa09f8139715c282ee49df764da2cfe53d4ced (diff) |
do not treat hafas=0 as "HAFAS enabled"
-rw-r--r-- | public/static/js/collapse.js | 4 | ||||
-rw-r--r-- | public/static/js/geostop.js | 6 |
2 files changed, 7 insertions, 3 deletions
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')); |