Only add button classes to actions that actually are buttons
This commit is contained in:
parent
d8b1bb3882
commit
2e9b3e882d
|
@ -61,15 +61,19 @@ export function userActionHandler(event: Event): void {
|
||||||
case 'block':
|
case 'block':
|
||||||
button.dataset.action = 'unblock';
|
button.dataset.action = 'unblock';
|
||||||
button.querySelector('span').innerText = I18n.translate('views.actions.unblock');
|
button.querySelector('span').innerText = I18n.translate('views.actions.unblock');
|
||||||
button.classList.remove('btn-primary');
|
if (button.classList.contains('btn')) {
|
||||||
button.classList.add('btn-default');
|
button.classList.remove('btn-primary');
|
||||||
|
button.classList.add('btn-default');
|
||||||
|
}
|
||||||
resetFollowButton(document.querySelector<HTMLButtonElement>('button[data-action="unfollow"]'));
|
resetFollowButton(document.querySelector<HTMLButtonElement>('button[data-action="unfollow"]'));
|
||||||
break;
|
break;
|
||||||
case 'unblock':
|
case 'unblock':
|
||||||
button.dataset.action = 'block';
|
button.dataset.action = 'block';
|
||||||
button.querySelector('span').innerText = I18n.translate('views.actions.block');
|
button.querySelector('span').innerText = I18n.translate('views.actions.block');
|
||||||
button.classList.remove('btn-default');
|
if (button.classList.contains('btn')) {
|
||||||
button.classList.add('btn-primary');
|
button.classList.remove('btn-default');
|
||||||
|
button.classList.add('btn-primary');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue