feat(web): click Executions' Started time to toggle relative/absolute
Both renderings are pre-rendered server-side into a <button>'s data-relative/data-absolute attributes; app.js swaps textContent (and the hover title, to the opposite value) on click, delegated on document.body so it survives the card's own 5s htmx poll without needing to re-wire after every swap. Click again to swap back.
This commit is contained in:
@@ -204,6 +204,22 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Executions "Started" cell: click swaps between the relative and
|
||||
// absolute time already rendered into the button's own data attributes --
|
||||
// no request. Delegated on body (not the button itself) so it keeps
|
||||
// working after the Executions card's own 5s htmx poll replaces the row.
|
||||
document.body.addEventListener("click", function (evt) {
|
||||
var btn = evt.target.closest(".time-toggle");
|
||||
if (!btn) {
|
||||
return;
|
||||
}
|
||||
var next = btn.dataset.showing === "relative" ? "absolute" : "relative";
|
||||
var shown = next === "relative" ? "absolute" : "relative";
|
||||
btn.textContent = btn.dataset[next];
|
||||
btn.title = btn.dataset[shown];
|
||||
btn.dataset.showing = next;
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
observeStack();
|
||||
processSlot(document.getElementById("action-slot"));
|
||||
|
||||
Reference in New Issue
Block a user