aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-13 15:32:17 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-13 15:32:17 +0200
commit0d250489ebe5570e1e2e8d23c9c2fda437b36f4a (patch)
treebcde8b7ff9ea7555841a8378b3c3a4f11c1d77d4
parentJS Move eventCreation functions into class. (diff)
downloadcalp-0d250489ebe5570e1e2e8d23c9c2fda437b36f4a.tar.gz
calp-0d250489ebe5570e1e2e8d23c9c2fda437b36f4a.tar.xz
Javascript use strict.
-rw-r--r--static/script.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js
index e6df3e0c..58642b09 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,3 +1,5 @@
+'use strict';
+
function makeElement (name, attr={}) {
let element = document.createElement(name);
for (let [key, value] of Object.entries(attr)) {
@@ -471,7 +473,7 @@ function bind_properties (el) {
let field = child.tagName;
- lst = el.properties["_slot_" + field] = []
+ let lst = el.properties["_slot_" + field] = []
for (let s of el.getElementsByClassName(field)) {
let f = ((s, v) => s.innerHTML = v.format(s.dataset && s.dataset.fmt));
lst.push([s, f]);