From 4413fe85f8165d8066743784fa5907693c8d8f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 28 Apr 2020 02:54:01 +0200 Subject: Minor JS cleanup. --- static/script.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'static') diff --git a/static/script.js b/static/script.js index c6d7ad10..b7526ee5 100644 --- a/static/script.js +++ b/static/script.js @@ -145,8 +145,6 @@ function toggle_event_pupup () { this.getElementsByClassName("popup")[0].classList.toggle("show"); } -let days; - function min(a, b) { return a < b ? a : b; } @@ -166,6 +164,8 @@ https://stackoverflow.com/questions/21064101/understanding-offsetwidth-clientwid */ function new_popup (event) { + let days = document.getElementsByClassName("days")[0] + console.log(event.target); console.log(this); // if (event.target !== this) return; @@ -245,11 +245,6 @@ window.onload = function () { } } - // for (let e of document.getElementsByClassName("event-inner")) { - // e.onclick = toggle_event_pupup; - // } - - days = document.getElementsByClassName("days")[0] for (let popup of document.getElementsByClassName("popup")) { ev = parents_until(popup, {class: "event"}) e = ev.getElementsByClassName("body")[0] @@ -260,8 +255,4 @@ window.onload = function () { e.parentElement.removeAttribute("href"); } - // days.scrollLeft == 0 - // days.offsetWidth == viewable width - // days.offsetHeight == viewable height - } -- cgit v1.2.3