cm-chessboard 5.4.6 → 5.4.8
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.
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
import {Chessboard, COLOR, INPUT_EVENT_TYPE} from "../../src/cm-chessboard/Chessboard.js"
|
|
23
23
|
import {PromotionDialog} from "../../src/cm-chessboard/extensions/promotion-dialog/PromotionDialog.js"
|
|
24
24
|
|
|
25
|
+
const position = "4k3/1P6/8/8/6r1/8/8/2R1K3 w - - 0 1"
|
|
25
26
|
const chessboard = new Chessboard(document.getElementById("chessboard"), {
|
|
26
|
-
position:
|
|
27
|
+
position: position,
|
|
27
28
|
sprite: {
|
|
28
29
|
url: "../../assets/images/chessboard-sprite.svg", // pieces and markers are stored in a sprite file
|
|
29
30
|
},
|
|
@@ -39,6 +40,8 @@
|
|
|
39
40
|
console.log("48a99d Piece selected", event.piece)
|
|
40
41
|
if(event.piece) {
|
|
41
42
|
chessboard.setPiece(event.square, event.piece, true)
|
|
43
|
+
} else {
|
|
44
|
+
chessboard.setPosition(position)
|
|
42
45
|
}
|
|
43
46
|
})
|
|
44
47
|
}
|