diff options
Diffstat (limited to 'static')
-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) + } /* */ |