]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Fixed tooltip bug in accuracy/damage graphs
authorJan D. Behrens <zykure@web.de>
Fri, 3 Aug 2012 11:23:43 +0000 (13:23 +0200)
committerJan D. Behrens <zykure@web.de>
Sat, 4 Aug 2012 13:25:27 +0000 (15:25 +0200)
xonstat/templates/player_info.mako

index 19835094182d57d79b3df596054e7dfd672396e0..2b580464ed8cf0761ada7a537faa6e7009b91e3a 100644 (file)
@@ -77,10 +77,12 @@ ${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)) {
                     previousPoint = item.dataIndex;
+                    previousLabel = item.series.label;
 
                     $("#tooltip").remove();
                     var x = item.datapoint[0].toFixed(2),
@@ -92,6 +94,7 @@ ${nav.nav('players')}
               else {
                   $("#tooltip").remove();
                   previousPoint = null;
+                  previousLabel = null;
               }
           });