Bug 1348271 - attach eyedropper click event to the proper element;r=zer0 draft
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 17 Mar 2017 12:50:28 +0100
changeset 500687 46a68d26d6ccf384a0c1fdaa91d4c281ecb32c74
parent 500240 39607304b774591fa6e32c4b06158d869483c312
child 500811 6bbfd54250a6aade51572833db16889a0694abae
push id49765
push userjdescottes@mozilla.com
push dateFri, 17 Mar 2017 11:52:02 +0000
reviewerszer0
bugs1348271
milestone55.0a1
Bug 1348271 - attach eyedropper click event to the proper element;r=zer0 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");