Make unembed button also collapse spoilers.

This commit is contained in:
flash 2024-05-14 17:45:48 +00:00
parent a7c0c400cd
commit c267b1d73b
3 changed files with 5 additions and 2 deletions

View file

@ -107,7 +107,8 @@
} }
.sidebar__selector-mode--unembed:before { .sidebar__selector-mode--unembed:before {
content: "\f127" font-weight: 400;
content: "\f146"
} }
.sidebar__selector-mode--clear { .sidebar__selector-mode--clear {

View file

@ -369,7 +369,7 @@ window.Umi = { UI: {} };
for(const button of buttons) for(const button of buttons)
button.click(); button.click();
} }
}, 'Unembed any embedded media'); }, 'Collapse any expanded elements');
Umi.UI.Toggles.Add('clear', { Umi.UI.Toggles.Add('clear', {
'click': function() { 'click': function() {

View file

@ -321,10 +321,12 @@ Umi.Parsing = (function() {
if(container.dataset.revealed === 'yes') { if(container.dataset.revealed === 'yes') {
container.dataset.revealed = 'no'; container.dataset.revealed = 'no';
target.textContent = '*** HIDDEN ***'; target.textContent = '*** HIDDEN ***';
element.dataset.embed = '0';
element.textContent = 'Reveal'; element.textContent = 'Reveal';
} else { } else {
container.dataset.revealed = 'yes'; container.dataset.revealed = 'yes';
target.textContent = container.dataset.shit; target.textContent = container.dataset.shit;
element.dataset.embed = '1';
element.textContent = 'Hide'; element.textContent = 'Hide';
} }
}; };