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';
+ }
}
});
%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?)})