From 4babf5b8b5ba8eca5a14f3b2813775240db8f8f1 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 1 Jul 2020 13:51:50 +0200 Subject: Fix lock icon not being shown when locking account in profile settings (#14190) --- app/javascript/packs/public.js | 10 ++++++---- app/javascript/styles/mastodon/accounts.scss | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 557823c96..08cc662e6 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -207,10 +207,12 @@ function main() { delegate(document, '#account_locked', 'change', ({ target }) => { const lock = document.querySelector('.card .display-name i'); - if (target.checked) { - lock.style.display = 'inline'; - } else { - lock.style.display = 'none'; + if (lock) { + if (target.checked) { + delete lock.dataset.hidden; + } else { + lock.dataset.hidden = 'true'; + } } }); diff --git a/app/javascript/styles/mastodon/accounts.scss b/app/javascript/styles/mastodon/accounts.scss index 5dc067f0e..2c78e81be 100644 --- a/app/javascript/styles/mastodon/accounts.scss +++ b/app/javascript/styles/mastodon/accounts.scss @@ -76,6 +76,10 @@ margin-left: 15px; text-align: left; + i[data-hidden] { + display: none; + } + strong { font-size: 15px; color: $primary-text-color; -- cgit