Title: [166723] trunk/Websites/perf.webkit.org
Revision
166723
Author
rn...@webkit.org
Date
2014-04-03 09:36:18 -0700 (Thu, 03 Apr 2014)

Log Message

WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
https://bugs.webkit.org/show_bug.cgi?id=131155

Reviewed by Andreas Kling.

The bug was caused by Chart.attach binding event listeners on plot container on each call.
This resulted in the click event handler toggling the visiblity of the tooltip twice upon
click when attach() has been called even number of times, keeping the tooltip invisible.

Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
is called for the first time.

* public/index.html:
(Chart.attach):
(Chart..bindPlotEventHandlers):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (166722 => 166723)


--- trunk/Websites/perf.webkit.org/ChangeLog	2014-04-03 16:29:32 UTC (rev 166722)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2014-04-03 16:36:18 UTC (rev 166723)
@@ -1,5 +1,24 @@
 2014-04-03  Ryosuke Niwa  <rn...@webkit.org>
 
+        WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
+        https://bugs.webkit.org/show_bug.cgi?id=131155
+
+        Reviewed by Andreas Kling.
+
+        The bug was caused by Chart.attach binding event listeners on plot container on each call.
+        This resulted in the click event handler toggling the visiblity of the tooltip twice upon
+        click when attach() has been called even number of times, keeping the tooltip invisible.
+
+        Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
+        a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
+        is called for the first time.
+
+        * public/index.html:
+        (Chart.attach):
+        (Chart..bindPlotEventHandlers):
+
+2014-04-03  Ryosuke Niwa  <rn...@webkit.org>
+
         WebKitPerfMonitor: Tooltips can be cut off at the top
         https://bugs.webkit.org/show_bug.cgi?id=130960
 

Modified: trunk/Websites/perf.webkit.org/public/index.html (166722 => 166723)


--- trunk/Websites/perf.webkit.org/public/index.html	2014-04-03 16:29:32 UTC (rev 166722)
+++ trunk/Websites/perf.webkit.org/public/index.html	2014-04-03 16:36:18 UTC (rev 166723)
@@ -739,12 +739,16 @@
             else
                 this.attachMainPlot(minTime);
 
-            var self = this;
+            if (bindPlotEventHandlers)
+                bindPlotEventHandlers(this);
+            bindPlotEventHandlers = null;
+        };
 
+        function bindPlotEventHandlers(chart) {
             // FIXME: Crosshair should stay where it was between charts.
             $(plotContainer).bind("plothover", function (event, pos, item) {
                 for (var i = 0; i < charts.length; i++) {
-                    if (charts[i] !== self) {
+                    if (charts[i] !== chart) {
                         charts[i].setCrosshair(pos);
                         charts[i].hideTooltip();
                     }
@@ -782,8 +786,8 @@
                         toggleClickTooltip(tooltip.currentItem.dataIndex, tooltip.currentItem.pageX, tooltip.currentItem.pageY);
                 });
             }
-        };
-        
+        }
+
         charts.push(this);
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to