From 2e684fd427097965834bd5f1f22196be99b82757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 19:49:28 +0200 Subject: Allow events to enter edit mode after creation. --- module/html/vcomponent.scm | 3 +++ static/script.js | 1 + static/style.css | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/html/vcomponent.scm b/module/html/vcomponent.scm index ca8a81c2..308f779a 100644 --- a/module/html/vcomponent.scm +++ b/module/html/vcomponent.scm @@ -175,6 +175,9 @@ title: "Stäng" onclick: "close_popup(document.getElementById(this.closest('.popup-container').id))" class: '("close-tooltip")) + ,(btn "🖊️" + title: "Redigera" + onclick: "place_in_edit_mode(document.getElementById(this.closest('.popup-container').id.substr(5)))") ,(btn "🗑" title: "Ta bort" onclick: "remove_event(document.getElementById(this.closest('.popup-container').id.substr(5)))")) diff --git a/static/script.js b/static/script.js index be19dc13..37f86549 100644 --- a/static/script.js +++ b/static/script.js @@ -428,6 +428,7 @@ function place_in_edit_mode (event) { let input = makeElement ('input', { type: "time", required: true, + value: field.innerText, onchange: function (e) { /* Only update datetime when the input is filled out */ diff --git a/static/style.css b/static/style.css index 193cc1fb..3a2a8c5d 100644 --- a/static/style.css +++ b/static/style.css @@ -509,7 +509,7 @@ along with their colors. overflow: visible; } -.event input { +.popup input { white-space: initial; border: 1px solid gray; max-width: 100%; -- cgit v1.2.3