Bug 1311409 - Eyedropper click doesn't work, have to use Enter key. r=me, a=ritu
authorMichael Ratcliffe <mratcliffe@mozilla.com>
Sat, 22 Oct 2016 00:22:01 +0100
changeset 350811 b5b9398d03100e6610d17de9b1fa502a16c7a740
parent 350810 5ebcf218f6784fc8cd376c3f3071b6d1aa17e302
child 350812 075f767684d1c02759e72b69d0b565fbbc002a4e
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, ritu
bugs1311409
milestone50.0
Bug 1311409 - Eyedropper click doesn't work, have to use Enter key. r=me, a=ritu
devtools/server/actors/highlighters/eye-dropper.js
--- a/devtools/server/actors/highlighters/eye-dropper.js
+++ b/devtools/server/actors/highlighters/eye-dropper.js
@@ -135,17 +135,17 @@ EyeDropper.prototype = {
     // eyedropper UI will appear in the screenshot itself (since the UI is injected as
     // native anonymous content in the page).
     // Once the screenshot is ready, the magnified area will be drawn.
     this.prepareImageCapture();
 
     // Start listening for user events.
     let {pageListenerTarget} = this.highlighterEnv;
     pageListenerTarget.addEventListener("mousemove", this);
-    pageListenerTarget.addEventListener("click", this);
+    pageListenerTarget.addEventListener("click", this, true);
     pageListenerTarget.addEventListener("keydown", this);
     pageListenerTarget.addEventListener("DOMMouseScroll", this);
     pageListenerTarget.addEventListener("FullZoomChange", this);
 
     // Show the eye-dropper.
     this.getElement("root").removeAttribute("hidden");
 
     // Prepare the canvas context on which we're drawing the magnified page portion.
@@ -166,17 +166,17 @@ EyeDropper.prototype = {
   /**
    * Hide the eye-dropper highlighter.
    */
   hide() {
     this.pageImage = null;
 
     let {pageListenerTarget} = this.highlighterEnv;
     pageListenerTarget.removeEventListener("mousemove", this);
-    pageListenerTarget.removeEventListener("click", this);
+    pageListenerTarget.removeEventListener("click", this, true);
     pageListenerTarget.removeEventListener("keydown", this);
     pageListenerTarget.removeEventListener("DOMMouseScroll", this);
     pageListenerTarget.removeEventListener("FullZoomChange", this);
 
     this.getElement("root").setAttribute("hidden", "true");
     this.getElement("root").removeAttribute("drawn");
 
     this.emit("hidden");