summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/static/js/collapse.js32
-rw-r--r--sass/app.scss4
-rw-r--r--sass/dark.scss1
-rw-r--r--sass/light.scss1
4 files changed, 38 insertions, 0 deletions
diff --git a/public/static/js/collapse.js b/public/static/js/collapse.js
index 9763f26..8aed392 100644
--- a/public/static/js/collapse.js
+++ b/public/static/js/collapse.js
@@ -105,6 +105,38 @@ function dbf_reg_handlers() {
history.pushState({'page':'traindetail','station':station,'train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + trainElem.data('station') + suffix);
dbf_show_moreinfo(trainElem, false);
});
+ const trainid = $(location).attr('hash').substr(1);
+ if (trainid) {
+ var found = false;
+ $('div.app > ul > li').each(function(index) {
+ if (found) {
+ return;
+ }
+ $(this).find('.anchor').each(function() {
+ if ($(this).attr('id') == trainid) {
+ found = true;
+ }
+ });
+ });
+ if (found) {
+ found = false;
+ $('div.app > ul > li').each(function(index) {
+ if (found) {
+ return;
+ }
+ $(this).find('.anchor').each(function() {
+ if ($(this).attr('id') == trainid) {
+ found = true;
+ }
+ });
+ if (found) {
+ $(this).addClass('selected');
+ } else {
+ $(this).addClass('past');
+ }
+ });
+ }
+ }
}
$(function() {
diff --git a/sass/app.scss b/sass/app.scss
index 236cc18..deb599b 100644
--- a/sass/app.scss
+++ b/sass/app.scss
@@ -266,6 +266,10 @@ div.app {
background-color: $cancelled-bg-color;
}
+ &.past {
+ background-color: $past-bg-color;
+ }
+
> a {
color:$fg;
}
diff --git a/sass/dark.scss b/sass/dark.scss
index 725b8dd..bd56d9d 100644
--- a/sass/dark.scss
+++ b/sass/dark.scss
@@ -37,6 +37,7 @@ $additional-stop-color: #77ff77;
$cancelled-stop-color: #ff7777;
$cancelled-bg-color: #512f00;
+$past-bg-color: $bg1;
$firstclass-wagon-color: #333300;
$powercar-wagon-color: #222222;
diff --git a/sass/light.scss b/sass/light.scss
index 156077f..6410b0a 100644
--- a/sass/light.scss
+++ b/sass/light.scss
@@ -37,6 +37,7 @@ $additional-stop-color: #009900;
$cancelled-stop-color: #cc0000;
$cancelled-bg-color: #ffe7d0;
+$past-bg-color: $bg05;
$firstclass-wagon-color: #ffff99;
$powercar-wagon-color: #cccccc;