Skip to content

Commit 7c337ad

Browse files
committed
Add click to show/hide in inbox <summary>s
1 parent b55db94 commit 7c337ad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ async function inbox (dataArray, fresh=true) {
9292
details.append(summary);
9393
summary.classList.add('d-flex', 'justify-content-between', 'alert', 'alert-warning');
9494
summary.innerHTML = `<span><strong>FormID:</strong> ${origin}</span>
95+
<span class="ms-2 me-auto">[Click to show]</span>
9596
<span class="badge bg-primary rounded-pill" id="${category}Unread" hidden>0</span>`;
9697

9798
const copyBtn = document.createElement('button');
@@ -132,13 +133,15 @@ async function inbox (dataArray, fresh=true) {
132133
inboxUnread.innerText = parseInt(inboxUnread.innerText) - parseInt(categoryUnread.innerText);
133134
categoryUnread.innerText = 0;
134135
categoryUnread.toggleAttribute('hidden', true);
136+
summary.querySelectorAll('span')[1].innerText = '[Click to hide]';
135137
} else {
136138
/* the element was toggled closed */
137139
// Unaccentuate old messages
138140
Array.from(tableBody.querySelectorAll('tr.table-primary'))
139141
.forEach((el) => {
140142
el.classList.remove('table-primary');
141143
});
144+
summary.querySelectorAll('span')[1].innerText = '[Click to show]';
142145
}
143146
});
144147
}

0 commit comments

Comments
 (0)