cm-chessboard 7.3.0 → 7.3.2
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/README.md +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/cm-chessboard/view/ChessboardView.js +4 -2
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The core of cm-chessboard is small, fast and reduced to the essentials. You can
|
|
|
25
25
|
- [Accessibility Extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/accessibility-extension.html) - makes the chessboard more accessible
|
|
26
26
|
- [Arrows Extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/arrows-extension.html) - renders arrows on the chessboard
|
|
27
27
|
- [Markers Extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/markers-extension.html) 🆕 - create markers on specific squares
|
|
28
|
-
- [PromotionDialog Extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/promotion-dialog-extension.html) - shows a dialog to select the piece to promote to
|
|
28
|
+
- [PromotionDialog Extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/promotion-dialog-extension.html) 🆕 - shows a dialog to select the piece to promote to
|
|
29
29
|
- [RenderVideo Extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/render-video-extension.html) 🆕 - renders a video from the pieces movement on the board
|
|
30
30
|
|
|
31
31
|
## Demo and repository
|
package/index.html
CHANGED
|
@@ -31,7 +31,7 @@ It works, it is cool and it is easy to use. 👍</p>
|
|
|
31
31
|
<li><a href="examples/extensions/accessibility-extension.html">Accessibility extension</a></li>
|
|
32
32
|
<li><a href="examples/extensions/arrows-extension.html">Arrows extension</a></li>
|
|
33
33
|
<li><a href="examples/extensions/markers-extension.html">Markers extension</a> 🆕</li>
|
|
34
|
-
<li><a href="examples/extensions/promotion-dialog-extension.html">PromotionDialog extension</a
|
|
34
|
+
<li><a href="examples/extensions/promotion-dialog-extension.html">PromotionDialog extension</a> 🆕</li>
|
|
35
35
|
<li><a href="examples/extensions/render-video-extension.html">RenderVideo extension</a> 🆕</li>
|
|
36
36
|
</ul>
|
|
37
37
|
</div>
|
package/package.json
CHANGED
|
@@ -290,12 +290,14 @@ export class ChessboardView {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
getPieceElement(square) {
|
|
293
|
-
if (square.length < 2) {
|
|
294
|
-
|
|
293
|
+
if (!square || square.length < 2) {
|
|
294
|
+
console.warn("invalid square", square)
|
|
295
|
+
return null
|
|
295
296
|
}
|
|
296
297
|
const piece = this.piecesGroup.querySelector(`g[data-square='${square}']`)
|
|
297
298
|
if (!piece) {
|
|
298
299
|
console.warn("no piece on", square)
|
|
300
|
+
return null
|
|
299
301
|
}
|
|
300
302
|
return piece
|
|
301
303
|
}
|