[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch main updated: js: Fix users of generateElements.
From: |
Ricardo Wurmus |
Subject: |
branch main updated: js: Fix users of generateElements. |
Date: |
Mon, 25 Mar 2024 06:57:10 -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 f1615aa js: Fix users of generateElements.
f1615aa is described below
commit f1615aa5a651ab536cbe144172a9cf790606c864
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Mar 25 11:56:24 2024 +0100
js: Fix users of generateElements.
* src/static/js/build-log.js: Always pick first element from HTMLCollection.
---
src/static/js/build-log.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/static/js/build-log.js b/src/static/js/build-log.js
index 668f019..7749252 100644
--- a/src/static/js/build-log.js
+++ b/src/static/js/build-log.js
@@ -93,7 +93,7 @@ ready(() => {
var openness = true;
const classOpened = "d-flex mb-3 lead text-info oi oi-fullscreen-exit";
const classClosed = "d-flex mb-3 lead text-info oi oi-fullscreen-enter";
- const button = generateElements('<div id="phase-folding-button"
title="Toggle phase visibility."></div>');
+ const button = generateElements('<div id="phase-folding-button"
title="Toggle phase visibility."></div>')[0];
button.className = classOpened;
button.addEventListener('click', (e) => {
openness = !openness;
@@ -111,8 +111,8 @@ ready(() => {
if (phaseStartRx.exec(line)) {
// Open a <details> tag.
const match = phaseStartRx.exec(line);
- var details = generateElements('<details open></details>'),
- summary = generateElements('<summary
class="text-info"></summary>');
+ var details = generateElements('<details open></details>')[0],
+ summary = generateElements('<summary
class="text-info"></summary>')[0];
summary.textContent = match[1];
details.append(summary);
@@ -125,7 +125,7 @@ ready(() => {
const match = highlight.regexp.exec(line);
if (match) {
parent.append(line.substring(0, match.index));
- var span = generateElements('<span></span>');
+ var span = generateElements('<span></span>')[0];
span.className = highlight.style;
span.textContent = match[0];
parent.append(span);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch main updated: js: Fix users of generateElements.,
Ricardo Wurmus <=