Fix lock icon not being shown when locking account in profile settings (#14190)

lolsob-rspec
ThibG 2020-07-01 13:51:50 +02:00 committed by GitHub
parent 3e51b04d40
commit 9e14647df8
3 changed files with 11 additions and 5 deletions

View 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';
}
}
});

View File

@ -76,6 +76,10 @@
margin-left: 15px;
text-align: left;
i[data-hidden] {
display: none;
}
strong {
font-size: 15px;
color: $primary-text-color;

View 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?)})