X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=d6a08a875b8642332f76f6bf60222797eec36f6e;hb=0300e89e239df1e8385eb3294c9853381a71b519;hp=3d5290699366ff42ab8e0b7acb657fa94f0fee97;hpb=e961331f0f08ba475f53599442c0d330bd520c91;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 3d52906..d6a08a8 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -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();