Bug 1348271 - attach eyedropper click event to the proper element;r=gl
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 17 Mar 2017 12:50:28 +0100
changeset 500855 0d33d81b075fc1cdc2c497efdd43346b89864604
parent 500854 1da2122f3597fc4ab0c913152f98c47ee1b4ec99
child 500856 85ead1312fe6ca35789595f455788b599f599c9f
child 501112 78e70d84203d4a875b6da574dd2e07f01d13fa41
push id49816
push userbmo:tchiovoloni@mozilla.com
push dateFri, 17 Mar 2017 20:44:02 +0000
reviewersgl
bugs1348271
milestone55.0a1
Bug 1348271 - attach eyedropper click event to the proper element;r=gl MozReview-Commit-ID: GNb6WED0CiP
devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
--- a/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
+++ b/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
@@ -112,18 +112,17 @@ SwatchColorPickerTooltip.prototype = Her
       this._originalColor = this.currentSwatchColor.textContent;
       let color = this.activeSwatch.style.backgroundColor;
       this.spectrum.off("changed", this._onSpectrumColorChange);
       this.spectrum.rgb = this._colorToRgba(color);
       this.spectrum.on("changed", this._onSpectrumColorChange);
       this.spectrum.updateUI();
     }
 
-    let tooltipDoc = this.tooltip.doc;
-    let eyeButton = tooltipDoc.querySelector("#eyedropper-button");
+    let eyeButton = this.tooltip.container.querySelector("#eyedropper-button");
     let canShowEyeDropper = yield this.inspector.supportsEyeDropper();
     if (canShowEyeDropper) {
       eyeButton.disabled = false;
       eyeButton.removeAttribute("title");
       eyeButton.addEventListener("click", this._openEyeDropper);
     } else {
       eyeButton.disabled = true;
       eyeButton.title = L10N.getStr("eyedropper.disabled.title");