Browse Source

Implemented onclick for Refresh RSK

master
Kenneth Bruen 2 years ago
parent
commit
39ba4d279c
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 12
      view-train.js

12
view-train.js

@ -210,6 +210,10 @@ window.addEventListener('unload', function (e) {
} }
}) })
function rsk() {
refresh()
}
window.addEventListener('load', function (e) { window.addEventListener('load', function (e) {
if (!new URL(window.location.href).searchParams.has('train')) { if (!new URL(window.location.href).searchParams.has('train')) {
window.history.back() window.history.back()
@ -225,6 +229,12 @@ window.addEventListener('load', function (e) {
trainNumber = sp.get('train') trainNumber = sp.get('train')
date = sp.has('date') ? new Date(sp.get('date')) : new Date() date = sp.has('date') ? new Date(sp.get('date')) : new Date()
document.querySelectorAll('.rsk').forEach(function (rskElem) {
rskElem.addEventListener('click', function (e) {
rsk()
})
})
var content = document.getElementsByClassName('content')[0] var content = document.getElementsByClassName('content')[0]
content.focus() content.focus()
content.addEventListener('keydown', function (e) { content.addEventListener('keydown', function (e) {
@ -236,7 +246,7 @@ window.addEventListener('load', function (e) {
content.scrollBy(0, 50) content.scrollBy(0, 50)
break break
case 'SoftRight': case 'SoftRight':
refresh() rsk()
break break
case '*': case '*':
showKm = !showKm showKm = !showKm

Loading…
Cancel
Save