]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Fix a JavaScript hover issue (via zykure).
authorAnt Zucaro <azucaro@gmail.com>
Sun, 16 Sep 2012 18:54:41 +0000 (14:54 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 16 Sep 2012 18:54:41 +0000 (14:54 -0400)
xonstat/templates/player_info.mako

index 3149228e486c7b5c168efd5d4f43486818ba715f..4b9485838f39bb985e5e6f6748ebe49f58e07ee5 100644 (file)
@@ -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;
               }
           });