From ec5f60617f37bae2af4b4b996b5b760729594f32 Mon Sep 17 00:00:00 2001 From: FiniteLooper <463685+FiniteLooper@users.noreply.github.com> Date: Thu, 27 Jul 2023 21:41:46 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20FiniteLo?= =?UTF-8?q?oper/grainy@883dae0e08ef5c967c0e5962513435cfe8503866=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils.js b/utils.js index 65b46bf..4f66072 100644 --- a/utils.js +++ b/utils.js @@ -7,10 +7,11 @@ function $$(multiElSelector) { function toggleDisplay($elements) { function t(el) { const currentDisplay = getComputedStyle(el).display; - if (currentDisplay === 'block') { + if (currentDisplay !== 'none') { + el.attributes['data-prev-display'] = currentDisplay; el.style.display = 'none'; } else if (currentDisplay === 'none') { - el.style.display = 'block'; + el.style.display = el.attributes['data-prev-display'] ?? 'block'; } }