aboutsummaryrefslogtreecommitdiff
path: root/p/scripts/feed.js
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-03-04 13:30:45 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-03-04 13:30:45 +0100
commitb3239256dc6d188cda970adab516b3fcf1b86129 (patch)
treed8e65dd9784834ba2e82ce7ee94b4718f8af19ea /p/scripts/feed.js
parent27b71ffa99f7dff013fb8d51d020ed628e0d2ce6 (diff)
parent0fe0ce894cbad09757d719dd4b400b9862c1a12a (diff)
Merge branch 'edge' into latest
Diffstat (limited to 'p/scripts/feed.js')
-rw-r--r--p/scripts/feed.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/p/scripts/feed.js b/p/scripts/feed.js
index 1a6833db6..29af2a3ea 100644
--- a/p/scripts/feed.js
+++ b/p/scripts/feed.js
@@ -88,10 +88,17 @@ function init_disable_elements_on_update(parent) {
function init_select_show(parent) {
const listener = (select) => {
const options = select.querySelectorAll('option[data-show]');
+ const shows = {}; // To allow multiple options to show the same element
for (const option of options) {
- const elem = document.getElementById(option.dataset.show);
+ if (!shows[option.dataset.show]) {
+ shows[option.dataset.show] = option.selected;
+ }
+ }
+
+ for (const show in shows) {
+ const elem = document.getElementById(show);
if (elem) {
- elem.style.display = option.selected ? 'block' : 'none';
+ elem.style.display = shows[show] ? 'block' : 'none';
}
}
};