From: Ant Zucaro Date: Sun, 16 Sep 2012 18:54:41 +0000 (-0400) Subject: Fix a JavaScript hover issue (via zykure). X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2f4a1ecd6901b95ba26ee4acf0b3361a58f38731;p=xonotic%2Fxonstat.git Fix a JavaScript hover issue (via zykure). --- diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 3149228..4b94858 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -77,9 +77,11 @@ ${nav.nav('players')} } var previousPoint = null; + var previousLabel = null; $('#acc-graph').bind("plothover", function (event, pos, item) { if (item) { - if (previousPoint != item.dataIndex) { + if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) { + previousLabel = item.series.label; previousPoint = item.dataIndex; $("#tooltip").remove(); @@ -92,13 +94,15 @@ ${nav.nav('players')} else { $("#tooltip").remove(); previousPoint = null; + previousLabel = null; } }); $('#dmg-graph').bind("plothover", function (event, pos, item) { if (item) { - if (previousPoint != item.dataIndex) { + if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) { previousPoint = item.dataIndex; + previousLabel = item.series.label; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), @@ -110,6 +114,7 @@ ${nav.nav('players')} else { $("#tooltip").remove(); previousPoint = null; + previousLabel = null; } });