summaryrefslogtreecommitdiff
path: root/public/static/js/collapse.js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-10-09 19:21:03 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-10-09 19:21:03 +0200
commitbcc02b1935c367db49d57856eccf5152a91b6c45 (patch)
treec6165e036ada8bd42281afec793e49abc0e12ac4 /public/static/js/collapse.js
parent1feda8aef6ce963b30392529c8c60517c3950ed7 (diff)
deploy new back-button navigation for train details3.4.0
Diffstat (limited to 'public/static/js/collapse.js')
-rw-r--r--public/static/js/collapse.js4
1 files changed, 2 insertions, 2 deletions
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('<ul></ul>');
reload_app();
}
+ } else {
+ console.log("unhandled popstate! " + document.location);
}
};
});