Commit 53feed7d authored by Frank-Rainer Grahl's avatar Frank-Rainer Grahl
Browse files

Bug 1695869 - Use popupmenu directly when building special menus. r=IanN a=IanN

The popupmenu might not be a child yet when the eventlistener fires.
parent d76b74ff
......@@ -617,13 +617,14 @@
menu.setAttribute("special", type);
menu.setAttribute("generated", "true");
let popup = document.createElement("menupopup");
popup.setAttribute("class", this.getAttribute("class"));
popup.addEventListener("popupshowing",
() => this._buildSpecialSubmenu(menu),
{ once: true });
menu.appendChild(popup);
let menupopup = document.createElement("menupopup");
menupopup.setAttribute("class", this.getAttribute("class"));
menupopup
.addEventListener("popupshowing",
() => this._buildSpecialSubmenu(menu, menupopup),
{ once: true });
menu.appendChild(menupopup);
this.appendChild(menu);
]]></body>
</method>
......@@ -634,6 +635,7 @@
-->
<method name="_buildSpecialSubmenu">
<parameter name="menu"/>
<parameter name="menupopup"/>
<body><![CDATA[
let specialType = menu.getAttribute("special");
if (this._initializedSpecials.has(specialType))
......@@ -700,7 +702,7 @@
node.setAttribute("class", "folderMenuItem menuitem-iconic");
this._setCssSelectors(folderItem.folder, node);
node.setAttribute("generated", "true");
menu.menupopup.appendChild(node);
menupopup.appendChild(node);
}
if (specialFoldersMap.length == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment