Bug 1348271 - attach eyedropper click event to the proper element;r=zer0
MozReview-Commit-ID: GNb6WED0CiP
--- 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");