diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-11 17:19:37 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-11 17:19:37 +0200 |
commit | 5a91457a5b8595969957cd6676afc2fff858251e (patch) | |
tree | e6204e1c70e41d66a715e27dbf0099c97fe838a0 /static | |
parent | Remove week-start from (html view calendar) (again?) (diff) | |
download | calp-5a91457a5b8595969957cd6676afc2fff858251e.tar.gz calp-5a91457a5b8595969957cd6676afc2fff858251e.tar.xz |
HTML Created events now have a description.
Unfortunately they ALWAYS have a description.
Diffstat (limited to '')
-rw-r--r-- | static/script.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js index 32bc3b4b..c2ea07c1 100644 --- a/static/script.js +++ b/static/script.js @@ -473,6 +473,28 @@ function place_in_edit_mode (event) { /* ---------------------------------------- */ + let descs = popup.getElementsByClassName("description"); + if (descs.length === 1) { + let description = descs[0]; + let textarea = makeElement('textarea', { + name: "description", + placeholder: 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); + } + + /* ---------------------------------------- */ + let submit = makeElement( 'input', { type: 'submit', value: 'Skapa event', |