From 5bd679d562f992cad856099fbc98014dc4556801 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Tue, 4 Dec 2018 14:42:13 +0100
Subject: [PATCH] Fix Crazyhouse reserve initial position when selecting

---
 public/javascripts/components/game.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js
index 5c1e6024..308d415e 100644
--- a/public/javascripts/components/game.js
+++ b/public/javascripts/components/game.js
@@ -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) {
-- 
2.44.0