fix wrong label on save

when saving an entry the label was reset on complete
so the desired done label was never shown
This commit is contained in:
knrdl 2024-02-10 21:42:03 +01:00 committed by Frédéric Guillot
parent 2221fd408d
commit ccb9eed573

View file

@ -273,12 +273,11 @@ function saveEntry(element, toasting) {
return; return;
} }
let previousInnerHTML = element.innerHTML;
element.innerHTML = '<span class="icon-label">' + element.dataset.labelLoading + '</span>'; element.innerHTML = '<span class="icon-label">' + element.dataset.labelLoading + '</span>';
let request = new RequestBuilder(element.dataset.saveUrl); let request = new RequestBuilder(element.dataset.saveUrl);
request.withCallback(() => { request.withCallback(() => {
element.innerHTML = previousInnerHTML; element.innerHTML = '<span class="icon-label">' + element.dataset.labelDone + '</span>';
element.dataset.completed = true; element.dataset.completed = true;
if (toasting) { if (toasting) {
let iconElement = document.querySelector("template#icon-save"); let iconElement = document.querySelector("template#icon-save");