puzzle resizer

pull/5118/head
Thibault Duplessis 2019-05-13 16:09:16 +07:00
parent a4267984cd
commit d97c8a47ed
5 changed files with 11 additions and 9 deletions

View File

@ -59,6 +59,7 @@ final class JsonView(
"duration" -> p.animationFactor * animationDuration.toMillis
),
"destination" -> p.destination,
"resizeHandle" -> p.resizeHandle,
"moveEvent" -> p.moveEvent,
"highlight" -> p.highlight,
"is3d" -> p.is3d

View File

@ -365,6 +365,7 @@ export default function(opts, redraw: () => void): Controller {
promotion.cancel();
vm.justPlayed = undefined;
vm.autoScrollRequested = true;
window.lichess.pubsub.emit('ply')(vm.node.ply);
};
function userJump(path) {

View File

@ -1,6 +1,7 @@
import { h } from 'snabbdom'
import { Chessground } from 'chessground';
import { Config as CgConfig } from 'chessground/config';
import resizeHandle from 'common/resize';
export default function(ctrl) {
return h('div.cg-wrap', {
@ -36,7 +37,10 @@ function makeConfig(ctrl): CgConfig {
enabled: ctrl.pref.moveEvent !== 1
},
events: {
move: ctrl.userMove
move: ctrl.userMove,
insert(elements) {
resizeHandle(elements, ctrl.pref.resizeHandle, ctrl.vm.node.ply);
}
},
premovable: {
enabled: opts.premovable.enabled

View File

@ -3,7 +3,6 @@ import { VNode } from 'snabbdom/vnode'
import chessground from './chessground';
import { render as treeView } from './tree';
import { view as cevalView } from 'ceval';
import resizeHandle from 'common/resize';
import * as control from '../control';
import feedbackView from './feedback';
import historyView from './history';
@ -104,10 +103,7 @@ export default function(ctrl: Controller): VNode {
hook: hasTouchEvents ? undefined : bind('wheel', e => wheel(ctrl, e as WheelEvent))
}, [
chessground(ctrl),
ctrl.promotion.view(),
h('div.board-resize', {
hook: onInsert(resizeHandle)
})
ctrl.promotion.view()
]),
cevalView.renderGauge(ctrl),
h('div.puzzle__tools', [

View File

@ -1092,9 +1092,9 @@ chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.2:
resolved "https://codeload.github.com/ornicar/chess.js/tar.gz/ad0709c0b07773d9d0da8e4605a9a2a28f00d249"
chessground@^7.6:
version "7.6.0"
resolved "https://registry.yarnpkg.com/chessground/-/chessground-7.6.0.tgz#885ab6291642caecd24a55b8c73d70ab8fcd6025"
integrity sha512-Q8k9AttZ4gejCKB2or4Lrjq6y+IGMcUSs5Fk0KZJ9b646YxISVLWwiPVh5FUfoha4X3i/eaqUShE7/Egk5mnlw==
version "7.6.1"
resolved "https://registry.yarnpkg.com/chessground/-/chessground-7.6.1.tgz#cda1ce4cff3955b722a1fd2edc032a75519a83ff"
integrity sha512-hyHlYycVTtAW5AoLgs+tg+DPiN8z5dt4x23hYwtc6TnC7hwebZxtUKdNloKHCBHgQeXis/I/3PZ3m4DThBD8sA==
"chessground@github:ornicar/chessground#v4.4.0":
version "4.4.0"