From: Steinar H. Gunderson Date: Sat, 13 Dec 2014 23:52:00 +0000 (+0100) Subject: Fix history display with dropped pieces. X-Git-Url: https://git.sesse.net/?p=remoteglot-book;a=commitdiff_plain;h=4c5819ccf6f88f4ad0ed870921f8d972a46be8a0 Fix history display with dropped pieces. --- diff --git a/www/js/book.js b/www/js/book.js index 9a2456e..611678f 100644 --- a/www/js/book.js +++ b/www/js/book.js @@ -280,8 +280,13 @@ var onDrop = function(source, target) { // illegal move if (move === null) return 'snapback'; - history = game.history({ verbose: true }); + var new_history = game.history({ verbose: true }); + history = []; + for (var i = 0; i < new_history.length; ++i) { + history.push(new_history[i].san); + } move_override = history.length; + update(); }; // update the board position after the piece snap