Show "saving" labels for entry status button
This commit is contained in:
parent
93fd98f8d4
commit
571d7bf17c
2 changed files with 24 additions and 22 deletions
|
@ -20,6 +20,7 @@
|
||||||
<a href="#"
|
<a href="#"
|
||||||
title="{{ t "entry.status.title" }}"
|
title="{{ t "entry.status.title" }}"
|
||||||
data-toggle-status="true"
|
data-toggle-status="true"
|
||||||
|
data-label-loading="{{ t "entry.state.saving" }}"
|
||||||
data-label-read="{{ t "entry.status.read" }}"
|
data-label-read="{{ t "entry.status.read" }}"
|
||||||
data-label-unread="{{ t "entry.status.unread" }}"
|
data-label-unread="{{ t "entry.status.unread" }}"
|
||||||
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
|
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
|
||||||
|
|
|
@ -149,8 +149,8 @@ function toggleEntryStatus(element, toasting) {
|
||||||
let currentStatus = link.dataset.value;
|
let currentStatus = link.dataset.value;
|
||||||
let newStatus = currentStatus === "read" ? "unread" : "read";
|
let newStatus = currentStatus === "read" ? "unread" : "read";
|
||||||
|
|
||||||
updateEntriesStatus([entryID], newStatus);
|
link.querySelector("span").innerHTML = link.dataset.labelLoading;
|
||||||
|
updateEntriesStatus([entryID], newStatus, () => {
|
||||||
let iconElement, label;
|
let iconElement, label;
|
||||||
|
|
||||||
if (currentStatus === "read") {
|
if (currentStatus === "read") {
|
||||||
|
@ -174,6 +174,7 @@ function toggleEntryStatus(element, toasting) {
|
||||||
element.classList.remove("item-status-" + currentStatus);
|
element.classList.remove("item-status-" + currentStatus);
|
||||||
element.classList.add("item-status-" + newStatus);
|
element.classList.add("item-status-" + newStatus);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark a single entry as read.
|
// Mark a single entry as read.
|
||||||
|
|
Loading…
Reference in a new issue