/** @type {window.ChessBoard} @private */
var board = null;
+/** @type {boolean} @private */
+var board_is_animating = false;
+
/**
* The most recent analysis data we have from the server
* (about the most recent position).
}
var hiddenboard = chess_from(current_display_line.start_fen, current_display_line.pretty_pv, current_display_move);
+ board_is_animating = true;
+ var old_fen = board.fen();
board.position(hiddenboard.fen());
+ if (board.fen() === old_fen) board_is_animating = false;
update_imbalance(hiddenboard.fen());
}
}
// Create board.
- board = new window.ChessBoard('board', 'start');
+ board = new window.ChessBoard('board', {
+ onMoveEnd: function() { board_is_animating = false; }
+ });
request_update();
$(window).resize(function() {