aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-11 20:16:02 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-11 20:16:07 +0200
commite65184faa90ccc7760c90659e92080984afc0b3c (patch)
treed9c9dae1383d9c82ca7bbc71e7abb038294e7758
parentFocus summary when editing existing. (diff)
downloadcalp-e65184faa90ccc7760c90659e92080984afc0b3c.tar.gz
calp-e65184faa90ccc7760c90659e92080984afc0b3c.tar.xz
Expand whitespace.
-rw-r--r--static/script.js52
1 files 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);
+ }
+
/* ---------------------------------------- */