]> git.sesse.net Git - remoteglot/commitdiff
Fix extremely slow sparkline clicks.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 2 Aug 2020 14:56:45 +0000 (16:56 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 2 Aug 2020 14:56:45 +0000 (16:56 +0200)
www/js/remoteglot.js

index 2ba3fe95248401613e28c4498dbdcf1ba1c0f6a7..97efaca26b1e3f47f6541710f8566a4a7c3214d6 100644 (file)
@@ -1340,6 +1340,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',
@@ -1351,6 +1352,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();