From: Steinar H. Gunderson Date: Fri, 25 Nov 2016 21:07:46 +0000 (+0100) Subject: Allow navigating by clicking the sparkline. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=46a8b5d3b27eae92f91214dff1f8f5297766071d Allow navigating by clicking the sparkline. Patch from Chris Carlmar. --- diff --git a/www/index.html b/www/index.html index 94547e4..76718a5 100644 --- a/www/index.html +++ b/www/index.html @@ -72,25 +72,26 @@ © 2007–2016 Steinar H. Gunderson. Chess analysis by Stockfish. - Hosting and additional analysis hardware by Studentersamfundet i Trondhjem. + Hosting and additional analysis hardware by Studentersamfundet i Trondhjem + and Berge Schwebs Bjørlo. JavaScript chessboard powered by chessboard.js and chess.js. Ding sound by Aiwha (CC-BY-3.0). 7-man Lomonosov tablebase lookup by ChessOK.

- - diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 3568360..836b4ba 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1317,6 +1317,13 @@ var update_sparkline = function(data) { return format_tooltip(data, fields[0].offset + first_move_num - 1); } }); + $('#scorespark').bind('sparklineClick', function(event) { + var sparkline = event.sparklines[0]; + var region = sparkline.getCurrentRegionFields(); + if (region[0].offset !== undefined) { + show_line(0, first_move_num + region[0].offset - 1); + } + }); } else { $("#scorespark").text(""); }