From 98cb4069b83444b138bf947a984a44eec69db52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 13 Jul 2020 20:11:16 +0200 Subject: Javascript fixes. --- static/script.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/script.js b/static/script.js index e9826277..e38588e4 100644 --- a/static/script.js +++ b/static/script.js @@ -285,7 +285,7 @@ function place_in_edit_mode (event) { } }); let slot = event.properties["_slot_" + fieldname] - idx = slot.findIndex(e => e[0] === field); + let idx = slot.findIndex(e => e[0] === field); slot.splice(idx, 1, [input, (s, v) => s.value = v.format("%H:%M")]) field.replaceWith(input); @@ -309,7 +309,7 @@ function place_in_edit_mode (event) { } let slot = event.properties["_slot_summary"] - idx = slot.findIndex(e => e[0] === summary); + let idx = slot.findIndex(e => e[0] === summary); slot.splice(idx, 1, [input, (s, v) => s.value = v]) summary.replaceWith(input); @@ -411,10 +411,10 @@ window.onload = function () { } - /* Replace backend-driven [today] link with frontend, with one that gets - correctly set in the frontend. - Similarly, update the go to specific date button into a link which updates - wheneven the date form updates. + /* Replace backend-driven [today] link with frontend, with one that + gets correctly set in the frontend. Similarly, update the go to + specific date button into a link which updates wheneven the date + form updates. */ let jumpto = document.getElementsByClassName("jump-to")[0]; @@ -550,7 +550,7 @@ function bind_properties (el, wide_event=true) { // TODO right and bottom only works if used from the start. However, // events from the backend instead use top/left and width/height. // Normalize so all use the same, or find a way to convert between. - ? (s, v) => s.right = 100*(1 - (v-start_time)/(end_time-start_time)) + "%" + ? (s, v) => s.right = 100 * (1 - (v-start_time)/(end_time-start_time)) + "%" : (s, v) => s.bottom = (100 - date_to_percent(v)) + "%"]); } } -- cgit v1.2.3