]> git.sesse.net Git - remoteglot-book/blobdiff - www/js/book.js
Fix totals line.
[remoteglot-book] / www / js / book.js
index a489a6a3ed3c1a1dc0ef199789b870274ee42032..8f0c24164d4434142ff0cd1ddd958520f2aebab6 100644 (file)
@@ -97,9 +97,11 @@ var show_lines = function(data, game) {
        var total_num = 0;
        for (var i = 0; i < moves.length; ++i) {
                var move = moves[i];
-               total_num += parseInt(move['white']);
-               total_num += parseInt(move['draw']);
-               total_num += parseInt(move['black']);
+               if (move['move']) {
+                       total_num += parseInt(move['white']);
+                       total_num += parseInt(move['draw']);
+                       total_num += parseInt(move['black']);
+               }
        }
 
        var headings_tr = $("#headings");
@@ -177,7 +179,7 @@ var show_lines = function(data, game) {
                var line = lines[i];
                var tr = document.createElement("tr");
 
-               if (line[0] === undefined || line[0] === null) {
+               if (line[0] === undefined) {
                        $(tr).addClass("totals");
                }