From e3ce8cc5c13ee4ebf40a129a453d60491b4d2a49 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 16 Oct 2014 22:59:21 +0300 Subject: [PATCH] fix - drag durring opponent's turn Sorry for my language. Bug - When player drag piece durring opponent's turn, piece appears on board after opponent's move. Decision - It is check position on source dragged. --- js/chessboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/chessboard.js b/js/chessboard.js index 87c1d27c..444ded3e 100644 --- a/js/chessboard.js +++ b/js/chessboard.js @@ -975,7 +975,8 @@ function drawPositionInstant() { for (var i in CURRENT_POSITION) { if (CURRENT_POSITION.hasOwnProperty(i) !== true) continue; - $('#' + SQUARE_ELS_IDS[i]).append(buildPiece(CURRENT_POSITION[i])); + if(!DRAGGING_A_PIECE || i !== DRAGGED_PIECE_SOURCE) + $('#' + SQUARE_ELS_IDS[i]).append(buildPiece(CURRENT_POSITION[i])); } }