cm-chessboard 4.0.1-beta.3 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/PreMoves.md
ADDED
package/package.json
CHANGED
|
@@ -87,11 +87,7 @@ export class Chessboard {
|
|
|
87
87
|
if (props.accessibility) {
|
|
88
88
|
Object.assign(this.props.accessibility, props.accessibility)
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
if (this.props.style.aspectRatio) {
|
|
92
|
-
this.context.style.height = (this.context.offsetWidth * this.props.style.aspectRatio) + "px"
|
|
93
|
-
}
|
|
94
|
-
*/
|
|
90
|
+
|
|
95
91
|
this.state = new ChessboardState()
|
|
96
92
|
this.view = new ChessboardViewAccessible(this)
|
|
97
93
|
/*
|
|
@@ -215,7 +215,7 @@ export class ChessboardMoveInput {
|
|
|
215
215
|
if (e.type === "mousedown" && e.button === 0 || e.type === "touchstart") {
|
|
216
216
|
const square = e.target.getAttribute("data-square")
|
|
217
217
|
const pieceName = this.chessboard.getPiece(square)
|
|
218
|
-
console.log("onPointerDown", square, pieceName)
|
|
218
|
+
// console.log("onPointerDown", square, pieceName)
|
|
219
219
|
let color
|
|
220
220
|
if (pieceName) {
|
|
221
221
|
color = pieceName ? pieceName.substring(0, 1) : undefined
|
|
@@ -339,7 +339,7 @@ export class ChessboardMoveInput {
|
|
|
339
339
|
if (this.moveInputState === STATE.dragTo || this.moveInputState === STATE.clickDragTo) {
|
|
340
340
|
if (this.fromSquare === square) {
|
|
341
341
|
if (this.moveInputState === STATE.clickDragTo) {
|
|
342
|
-
this.chessboard.state.setPiece(this.fromSquare, this.movedPiece)
|
|
342
|
+
this.chessboard.state.position.setPiece(this.fromSquare, this.movedPiece)
|
|
343
343
|
this.view.setPieceVisibility(this.fromSquare)
|
|
344
344
|
this.moveCanceledCallback(MOVE_CANCELED_REASON.draggedBack, square, square)
|
|
345
345
|
this.setMoveInputState(STATE.reset)
|