]> git.sesse.net Git - remoteglot-book/blobdiff - www/js/book.js
Fix off-by-one in move history handling.
[remoteglot-book] / www / js / book.js
index 47e540e9a5c23535d90979662d5ca13e943ba6a8..efb68e3df5d5c8e6ff7fd5003b3d373d31c2aa44 100644 (file)
@@ -32,10 +32,10 @@ var update = function() {
                if (i % 2 == 0) {
                        text += (i/2 + 1) + ". ";
                }
-               if (i == move_override) {
+               if (i + 1 == move_override) {
                        text += '<strong>' + history[i] + '</strong>';
                } else {
-                       text += '<a href="javascript:set_move(' + i + ')">' + history[i] + '</a>';
+                       text += '<a href="javascript:set_move(' + (i + 1) + ')">' + history[i] + '</a>';
                }
                text += " ";
        }