Fix Crazyhouse reserve initial position when selecting
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 4 Dec 2018 13:42:13 +0000 (14:42 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 4 Dec 2018 13:42:13 +0000 (14:42 +0100)
public/javascripts/components/game.js

index 5c1e602..308d415 100644 (file)
@@ -755,7 +755,8 @@ Vue.component('my-game', {
                                this.possibleMoves = this.mode!="idle" && this.vr.canIplay(this.mycolor,startSquare)
                                        ? this.vr.getPossibleMovesFrom(startSquare)
                                        : [];
-                               e.target.parentNode.appendChild(this.selectedPiece);
+                               // Next line add moving piece just after current image (required for Crazyhouse reserve)
+                               e.target.parentNode.insertBefore(this.selectedPiece, e.target.nextSibling);
                        }
                },
                mousemove: function(e) {