Bug 1364166 - Only update combined buttons style in the customizableUI panel. r=Gijs
This Photon-specific workaround styles the zoom and edit
button combinations when the user switches back to the
old menu panel. Before this patch, it used to apply the
panel style even if the buttons were in the toolbar.
This patch fixes that by not even updating the style if
the buttons are not in the panel.
MozReview-Commit-ID: JZZUTudSDeZ
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -751,18 +751,19 @@ const CustomizableWidgets = [
aArea = aArea || this.currentArea;
updateCombinedWidgetStyle(node, aArea, true);
},
// Hack. This can go away when the old menu panel goes away (post photon).
// We need it right now for the case where we re-register the old-style
// main menu panel if photon is disabled at runtime, and we automatically
// put the widgets in there, so they get the right style in the panel.
- onAreaNodeRegistered(aArea, aContainer) {
+ onAreaNodeRegistered: (aArea, aContainer) => {
if (aContainer.ownerDocument == node.ownerDocument &&
+ aArea == this.currentArea &&
aArea == CustomizableUI.AREA_PANEL) {
updateCombinedWidgetStyle(node, aArea, true);
}
},
};
CustomizableUI.addListener(listener);
return node;
@@ -858,18 +859,19 @@ const CustomizableWidgets = [
aArea = aArea || this.currentArea;
updateCombinedWidgetStyle(node, aArea);
},
// Hack. This can go away when the old menu panel goes away (post photon).
// We need it right now for the case where we re-register the old-style
// main menu panel if photon is disabled at runtime, and we automatically
// put the widgets in there, so they get the right style in the panel.
- onAreaNodeRegistered(aArea, aContainer) {
+ onAreaNodeRegistered: (aArea, aContainer) => {
if (aContainer.ownerDocument == node.ownerDocument &&
+ aArea == this.currentArea &&
aArea == CustomizableUI.AREA_PANEL) {
updateCombinedWidgetStyle(node, aArea);
}
},
};
CustomizableUI.addListener(listener);
return node;