From 46a8b5d3b27eae92f91214dff1f8f5297766071d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 25 Nov 2016 22:07:46 +0100 Subject: [PATCH] Allow navigating by clicking the sparkline. Patch from Chris Carlmar. --- www/index.html | 7 ++++--- www/js/remoteglot.js | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) 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(""); } -- 2.39.2