[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch main updated: js: Fix phase toggle.
From: |
Ricardo Wurmus |
Subject: |
branch main updated: js: Fix phase toggle. |
Date: |
Tue, 26 Mar 2024 07:02:18 -0400 |
This is an automated email from the git hooks/post-receive script.
rekado pushed a commit to branch main
in repository guix-cuirass.
The following commit(s) were added to refs/heads/main by this push:
new 21c4200 js: Fix phase toggle.
21c4200 is described below
commit 21c42008ea342e0634dc7b425f88986a82a9260f
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Tue Mar 26 12:01:40 2024 +0100
js: Fix phase toggle.
* src/static/js/build-log.js (readLog): Remove "open" attribute to collapse
section.
---
src/static/js/build-log.js | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/static/js/build-log.js b/src/static/js/build-log.js
index 7749252..cbfc923 100644
--- a/src/static/js/build-log.js
+++ b/src/static/js/build-log.js
@@ -96,11 +96,14 @@ ready(() => {
const button = generateElements('<div id="phase-folding-button"
title="Toggle phase visibility."></div>')[0];
button.className = classOpened;
button.addEventListener('click', (e) => {
- openness = !openness;
- document.querySelectorAll("details").forEach((item) =>
- item.setAttribute('open', openness));
- console.log("button", e.target);
- e.target.setAttribute("class", openness ? classOpened :
classClosed);
+ openness = !openness;
+ document.querySelectorAll("details").forEach((item) => {
+ if (openness) {
+ item.setAttribute('open', openness);
+ } else
+ item.removeAttribute('open');
+ });
+ e.target.setAttribute("class", openness ? classOpened : classClosed);
});
build_log.prepend(button);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch main updated: js: Fix phase toggle.,
Ricardo Wurmus <=