]> cat aescling's git repositories - mastodon.git/commitdiff
Fix lock icon not being shown when locking account in profile settings (#14190)
authorThibG <thib@sitedethib.com>
Wed, 1 Jul 2020 11:51:50 +0000 (13:51 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Jul 2020 11:51:50 +0000 (13:51 +0200)
app/javascript/packs/public.js
app/javascript/styles/mastodon/accounts.scss
app/views/application/_card.html.haml

index 557823c96d8f7687065456b1fbe2c0d91d492bdb..08cc662e60b65c1e904dee7c06464d115256acdf 100644 (file)
@@ -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';
+      }
     }
   });
 
index 5dc067f0e8f6805d5f2c8a6eed3d45a6669c3b06..2c78e81be2fbf2df5b277ffbece83718b23f7cd6 100644 (file)
       margin-left: 15px;
       text-align: left;
 
+      i[data-hidden] {
+        display: none;
+      }
+
       strong {
         font-size: 15px;
         color: $primary-text-color;
index e7ecfecd9a1b8bd94929ef6b6acf2512901a7869..909d9ff818c7a3a328218ab0eeca323624e64592 100644 (file)
@@ -13,4 +13,4 @@
           %strong.emojify.p-name= display_name(account, custom_emojify: true)
         %span
           = acct(account)
-          = fa_icon('lock') if account.locked?
+          = fa_icon('lock', { :data => ({hidden: true} unless account.locked?)})