diff --git a/browser/base/content/browser-pageActions.js b/browser/base/content/browser-pageActions.js index 606e9e793903..98646e07d51a 100644 --- a/browser/base/content/browser-pageActions.js +++ b/browser/base/content/browser-pageActions.js @@ -69,6 +69,7 @@ var BrowserPageActions = { this._appendPanelSeparator(action); return; } + action.onBeforePlacedInWindow(window); this.placeActionInPanel(action, panelInsertBeforeID); this.placeActionInUrlbar(action, urlbarInsertBeforeID); }, @@ -176,7 +177,7 @@ var BrowserPageActions = { let panelNode = document.getElementById(panelNodeID); if (panelNode) { panelNode.hidePopup(); - return; + return null; } panelNode = document.createElement("panel"); @@ -205,9 +206,18 @@ var BrowserPageActions = { let popupSet = document.getElementById("mainPopupSet"); popupSet.appendChild(panelNode); panelNode.addEventListener("popuphidden", () => { + if (iframeNode) { + action.onIframeHidden(iframeNode, panelNode); + } panelNode.remove(); }, { once: true }); + panelNode.addEventListener("popuphiding", () => { + if (iframeNode) { + action.onIframeHiding(iframeNode, panelNode); + } + }, { once: true }); + if (panelViewNode) { action.subview.onPlaced(panelViewNode); action.subview.onShowing(panelViewNode); @@ -216,13 +226,22 @@ var BrowserPageActions = { this.panelNode.hidePopup(); let urlbarNodeID = this._urlbarButtonNodeIDForActionID(action.id); - let anchorNode = - document.getElementById(urlbarNodeID) || this.mainButtonNode; + let urlbarNode = document.getElementById(urlbarNodeID); + let anchorNode; + if (urlbarNode && !urlbarNode.hidden) { + anchorNode = action.anchorIDOverride ? + document.getElementById(action.anchorIDOverride) : + urlbarNode; + } else { + anchorNode = this.mainButtonNode; + } panelNode.openPopup(anchorNode, "bottomcenter topright"); if (iframeNode) { action.onIframeShown(iframeNode, panelNode); } + + return panelNode; }, get _tempPanelID() { @@ -411,6 +430,14 @@ var BrowserPageActions = { } }, + doCommandForAction(action) { + if (action.subview || action.wantsIframe) { + this._toggleTempPanelForAction(action); + return; + } + action.onCommand(); + }, + /** * Returns the action for a node. * diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index 60d33d6b673d..8c5ab7532006 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -664,7 +664,7 @@ html|input.urlbar-input[textoverflow]:not([focused]) { } #urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon, -#urlbar[pageproxystate="invalid"] > #urlbar-icons > #star-button-box > .urlbar-icon, +#urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon-wrapper > .urlbar-icon, .urlbar-go-button[pageproxystate="valid"], .urlbar-go-button:not([parentfocused="true"]), #urlbar[pageproxystate="invalid"] > #identity-box > #blocked-permissions-container, diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 39ad3423ac77..4660e5640457 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -899,6 +899,7 @@ onclick="BrowserPageActions.mainButtonClicked(event);"/>