From c267b1d73b0c980bd77c3818ca07ed564ce042b5 Mon Sep 17 00:00:00 2001 From: flashwave Date: Tue, 14 May 2024 17:45:48 +0000 Subject: [PATCH] Make unembed button also collapse spoilers. --- src/mami.css/sidebar.css | 3 ++- src/mami.js/main.js | 2 +- src/mami.js/parsing.js | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mami.css/sidebar.css b/src/mami.css/sidebar.css index f35dd39..721323a 100644 --- a/src/mami.css/sidebar.css +++ b/src/mami.css/sidebar.css @@ -107,7 +107,8 @@ } .sidebar__selector-mode--unembed:before { - content: "\f127" + font-weight: 400; + content: "\f146" } .sidebar__selector-mode--clear { diff --git a/src/mami.js/main.js b/src/mami.js/main.js index ab04659..cb88da8 100644 --- a/src/mami.js/main.js +++ b/src/mami.js/main.js @@ -369,7 +369,7 @@ window.Umi = { UI: {} }; for(const button of buttons) button.click(); } - }, 'Unembed any embedded media'); + }, 'Collapse any expanded elements'); Umi.UI.Toggles.Add('clear', { 'click': function() { diff --git a/src/mami.js/parsing.js b/src/mami.js/parsing.js index 18b694a..79da11f 100644 --- a/src/mami.js/parsing.js +++ b/src/mami.js/parsing.js @@ -321,10 +321,12 @@ Umi.Parsing = (function() { if(container.dataset.revealed === 'yes') { container.dataset.revealed = 'no'; target.textContent = '*** HIDDEN ***'; + element.dataset.embed = '0'; element.textContent = 'Reveal'; } else { container.dataset.revealed = 'yes'; target.textContent = container.dataset.shit; + element.dataset.embed = '1'; element.textContent = 'Hide'; } };