Bug 1355322 - Add anchor button to urlbar for action menu. r=Gijs
MozReview-Commit-ID: CajXNdGt9cZ
This commit is contained in:
@@ -1604,6 +1604,8 @@ var gBrowserInit = {
|
||||
}
|
||||
});
|
||||
|
||||
gPageActionButton.init();
|
||||
|
||||
this.delayedStartupFinished = true;
|
||||
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished");
|
||||
@@ -7756,6 +7758,38 @@ var gIdentityHandler = {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var gPageActionButton = {
|
||||
get button() {
|
||||
delete this.button;
|
||||
return this.button = document.getElementById("urlbar-page-action-button");
|
||||
},
|
||||
|
||||
get panel() {
|
||||
delete this.panel;
|
||||
return this.panel = document.getElementById("page-action-panel");
|
||||
},
|
||||
|
||||
init() {
|
||||
if (getBoolPref("browser.photon.structure.enabled")) {
|
||||
this.button.hidden = false;
|
||||
}
|
||||
},
|
||||
|
||||
onEvent(event) {
|
||||
event.stopPropagation();
|
||||
|
||||
if ((event.type == "click" && event.button != 0) ||
|
||||
(event.type == "keypress" && event.charCode != KeyEvent.DOM_VK_SPACE &&
|
||||
event.keyCode != KeyEvent.DOM_VK_RETURN)) {
|
||||
return; // Left click, space or enter only
|
||||
}
|
||||
|
||||
this.panel.hidden = false;
|
||||
this.panel.openPopup(this.button, "bottomcenter topright");
|
||||
},
|
||||
};
|
||||
|
||||
function getNotificationBox(aWindow) {
|
||||
var foundBrowser = gBrowser.getBrowserForDocument(aWindow.document);
|
||||
if (foundBrowser)
|
||||
|
||||
Reference in New Issue
Block a user