From 7c914d16b60fb72aa25aa469b60b85f06fb3a518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:05:40 +0200 Subject: Keep summary when editing existing elements. --- static/script.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'static') diff --git a/static/script.js b/static/script.js index 37f86549..7f9291d7 100644 --- a/static/script.js +++ b/static/script.js @@ -457,8 +457,9 @@ function place_in_edit_mode (event) { let summary = popup.getElementsByClassName("summary")[0]; let input = makeElement('input', { - name: "dtstart", - placeholder: summary.innerText, + name: "summary", + value: summary.innerText, + placeholder: "Sammanfattning", required: true, }); @@ -539,7 +540,7 @@ window.onload = function () { let popupElement = document.getElementById("popup" + event.id); open_popup(popupElement); - popupElement.querySelector("input[name='dtstart']").focus(); + popupElement.querySelector("input[name='summary']").focus(); }); } @@ -557,7 +558,7 @@ window.onload = function () { let popupElement = document.getElementById("popup" + event.id); open_popup(popupElement); - popupElement.querySelector("input[name='dtstart']").focus(); + popupElement.querySelector("input[name='summary']").focus(); }); } -- cgit v1.2.3