diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-05 23:52:11 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-05 23:52:11 +0200 |
commit | a7130d7fed8a651066419337b34e5af115a9fb53 (patch) | |
tree | dab91422262bf632f9ecb2575fed24a06ce8f23e | |
parent | Update JS to only try to mark today if posible. (diff) | |
download | calp-a7130d7fed8a651066419337b34e5af115a9fb53.tar.gz calp-a7130d7fed8a651066419337b34e5af115a9fb53.tar.xz |
Made script work better for month view.
-rw-r--r-- | static/script.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/static/script.js b/static/script.js index 7a0fe457..0240a26c 100644 --- a/static/script.js +++ b/static/script.js @@ -85,16 +85,18 @@ function update_current_time_bar () { var event_area = document.getElementById(time_to_date(now)) - if (bar_object) { - bar_object.parentNode.removeChild(bar_object) - } else { - bar_object = document.createElement("div") - bar_object.className = "event current-time" - bar_object.id = "bar" - } + if (event_area) { + if (bar_object) { + bar_object.parentNode.removeChild(bar_object) + } else { + bar_object = document.createElement("div") + bar_object.className = "event current-time" + bar_object.id = "bar" + } - bar_object.style.top = time_to_percent(now) - event_area.append(bar_object) + bar_object.style.top = time_to_percent(now) + event_area.append(bar_object) + } /* */ |