Skip to content

Commit

Permalink
Fix lock icon not being shown when locking account in profile settings (
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and Mage committed Jan 14, 2022
1 parent eb9c87f commit f3ba9a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions app/javascript/packs/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
});

Expand Down
4 changes: 4 additions & 0 deletions app/javascript/styles/mastodon/accounts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
margin-left: 15px;
text-align: left;

i[data-hidden] {
display: none;
}

strong {
font-size: 15px;
color: $primary-text-color;
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_card.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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?)})

0 comments on commit f3ba9a0

Please sign in to comment.