Use a class instead of an attribute

pull/5401/head
Adam Morris 2019-08-07 19:20:51 +10:00
parent fe1fd608bb
commit 17e071a979
2 changed files with 3 additions and 4 deletions

View File

@ -51,7 +51,7 @@
}
}
.toggle[filtered='yes'] {
.gamesFiltered {
color: $c-accent;
@include transition();
&:hover {

View File

@ -62,12 +62,11 @@ function initialize(ctrl: LobbyController, el) {
export function toggle(ctrl: LobbyController, nbFiltered: number) {
return h('i.toggle.toggle-filter', {
class: { active: ctrl.filterOpen },
class: { gamesFiltered: nbFiltered > 0, active: ctrl.filterOpen },
hook: bind('mousedown', ctrl.toggleFilter, ctrl.redraw),
attrs: {
'data-icon': ctrl.filterOpen ? 'L' : '%',
title: ctrl.trans.noarg('filterGames'),
'filtered': nbFiltered > 0 ? 'yes' : 'no'
title: ctrl.trans.noarg('filterGames')
}
});
}