restore mouse wheel on analysis

This commit is contained in:
Thibault Duplessis 2014-11-27 15:36:32 +01:00
parent 123fc6ef92
commit d4c9afb52d

View file

@ -227,9 +227,24 @@ function renderAnalyse(ctrl) {
tree);
}
function wheel(ctrl, e) {
if (e.deltaY > 0) control.next(ctrl);
else if (e.deltaY < 0) control.prev(ctrl);
m.redraw();
e.preventDefault();
return false;
}
function visualBoard(ctrl) {
return m('div.lichess_board_wrap',
m('div.lichess_board.' + ctrl.data.game.variant.key, chessground.view(ctrl.chessground)));
m('div.lichess_board.' + ctrl.data.game.variant.key, {
config: function(el, isUpdate) {
if (!isUpdate) el.addEventListener('wheel', function(e) {
return wheel(ctrl, e);
});
}
},
chessground.view(ctrl.chessground)));
}
function blindBoard(ctrl) {