restore mouse wheel on analysis
This commit is contained in:
parent
123fc6ef92
commit
d4c9afb52d
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue