X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fbook.js;h=611678f8f99c52a3e73ea53241e31b88766dd24c;hb=4c5819ccf6f88f4ad0ed870921f8d972a46be8a0;hp=9a2456ee6c081ca911681a2bb40f8c3b3555a2ec;hpb=a07f7e734dea29073dcc67d8398d36de420d7757;p=remoteglot-book 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