simplify analysis view code

This commit is contained in:
Thibault Duplessis 2015-01-05 09:49:45 +01:00
parent b38fa4a9e6
commit 37d0178ac2

View file

@ -270,20 +270,22 @@ function buttons(ctrl) {
m('div.jumps.hint--bottom', {
'data-hint': 'Tip: use your keyboard arrow keys!'
}, [
['first', 'W', control.first],
['first', 'W', control.first, ],
['prev', 'Y', control.prev],
['next', 'X', control.next],
['last', 'V', control.last]
].map(function(b) {
var enabled = true;
return m('a', {
class: 'button ' + b[0] + ' ' + classSet({
disabled: (ctrl.broken || !enabled),
glowing: ctrl.vm.late && b[0] === 'last'
}),
'data-icon': b[1],
onclick: enabled ? partial(b[2], ctrl) : null
});
return {
tag: 'a',
attrs: {
class: 'button ' + b[0] + ' ' + classSet({
disabled: ctrl.broken,
glowing: ctrl.vm.late && b[0] === 'last'
}),
'data-icon': b[1],
onclick: partial(b[2], ctrl)
}
};
})),
m('a.button.hint--bottom', flipAttrs, m('span[data-icon=B]')),
ctrl.data.inGame ? null : m('a.button.hint--bottom', {