Bug 979207 - add PanelUI panelshown listener before showing panel, r=mikedeboer

This commit is contained in:
Gijs Kruitbosch 2014-06-09 10:02:59 +01:00
parent 1eac04358e
commit 222894e19a

View File

@ -149,10 +149,6 @@ const PanelUI = {
} else {
anchor = aEvent.target;
}
let iconAnchor =
document.getAnonymousElementByAttribute(anchor, "class",
"toolbarbutton-icon");
this.panel.openPopup(iconAnchor || anchor);
this.panel.addEventListener("popupshown", function onPopupShown() {
this.removeEventListener("popupshown", onPopupShown);
@ -162,6 +158,11 @@ const PanelUI = {
gCustomizationTabPreloader.ensurePreloading();
deferred.resolve();
});
let iconAnchor =
document.getAnonymousElementByAttribute(anchor, "class",
"toolbarbutton-icon");
this.panel.openPopup(iconAnchor || anchor);
});
return deferred.promise;