]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Revert "Fix move highlights when collapsing/uncollapsing history."
[remoteglot] / www / js / remoteglot.js
index 3d5290699366ff42ab8e0b7acb657fa94f0fee97..d6a08a875b8642332f76f6bf60222797eec36f6e 100644 (file)
@@ -780,6 +780,10 @@ var update_refutation_lines = function() {
        var tbl = $("#refutationlines");
        tbl.empty();
 
+       if (display_lines.length < 2) {
+               return;
+       }
+
        // Find out where the lines start from.
        var base_line = [];
        var base_scores = display_lines[1].scores;
@@ -1335,6 +1339,7 @@ var update_sparkline = function(data) {
                        }
                        // FIXME: at some widths, calling sparkline() seems to push
                        // #scorecontainer under the board.
+                       $('#scorespark').unbind('sparklineClick');
                        $("#scorespark").sparkline(scores, {
                                type: 'bar',
                                zeroColor: 'gray',
@@ -1346,6 +1351,7 @@ var update_sparkline = function(data) {
                                        return format_tooltip(data, fields[0].offset + first_move_num - 1);
                                }
                        });
+                       $('#scorespark').unbind('sparklineClick');
                        $('#scorespark').bind('sparklineClick', function(event) {
                                var sparkline = event.sparklines[0];
                                var region = sparkline.getCurrentRegionFields();