From e65184faa90ccc7760c90659e92080984afc0b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:16:02 +0200 Subject: Expand whitespace. --- static/script.js | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/static/script.js b/static/script.js index 5b6f561a..cc647b77 100644 --- a/static/script.js +++ b/static/script.js @@ -459,7 +459,7 @@ function place_in_edit_mode (event) { let input = makeElement('input', { name: "summary", value: summary.innerText, - placeholder: "Sammanfattning", + placeholder: "Sammanfattning", required: true, }); @@ -475,30 +475,32 @@ function place_in_edit_mode (event) { /* ---------------------------------------- */ - /* TODO add elements if the arent't already there - * Almost all should be direct children of '.event-body'. - * Biggest problem is generated fields relative order. - */ - let descs = popup.getElementsByClassName("description"); - if (descs.length === 1) { - let description = descs[0]; - let textarea = makeElement('textarea', { - name: "description", - placeholder: "Description (optional)", - innerHTML: description.innerText, - required: false, - }); - - textarea.oninput = function () { - event.properties["description"] = this.value; - } - - let slot = event.properties["_slot_description"] - let idx = slot.findIndex(e => e[0] === description); - slot.splice(idx, 1, [input, (s, v) => s.innerHTML = v]) - - description.replaceWith(textarea); - } + /* TODO add elements if the arent't already there + * Almost all should be direct children of '.event-body' (or + * '.eventtext'?). + * Biggest problem is generated fields relative order. + */ + let descs = popup.getElementsByClassName("description"); + if (descs.length === 1) { + let description = descs[0]; + let textarea = makeElement('textarea', { + name: "description", + placeholder: "Description (optional)", + innerHTML: description.innerText, + required: false, + }); + + textarea.oninput = function () { + event.properties["description"] = this.value; + } + + let slot = event.properties["_slot_description"] + let idx = slot.findIndex(e => e[0] === description); + slot.splice(idx, 1, [input, (s, v) => s.innerHTML = v]) + + description.replaceWith(textarea); + } + /* ---------------------------------------- */ -- cgit v1.2.3