]> git.sesse.net Git - remoteglot-book/commitdiff
Remove highlight when we go back to first move.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 21 Dec 2014 12:32:34 +0000 (13:32 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 21 Dec 2014 12:32:34 +0000 (13:32 +0100)
www/js/book.js

index c6290f17cd13ff6dcaea29928a59834a8e995fe5..ebccd1ef2fdf99eb909134ecf3b1d5adcc6e6487 100644 (file)
@@ -48,11 +48,11 @@ var update = function() {
                board.position(current_display_fen());
        }
 
+       $("#board").find('.square-55d63').removeClass('nonuglyhighlight');
        if (move_override > 0) {
                var last_move = history[move_override - 1];
                var highlight_from = last_move.from;
                var highlight_to = last_move.to;
-               $("#board").find('.square-55d63').removeClass('nonuglyhighlight');
                $("#board").find('.square-' + highlight_from).addClass('nonuglyhighlight');
                $("#board").find('.square-' + highlight_to).addClass('nonuglyhighlight');
        }