summaryrefslogtreecommitdiffstats
path: root/devtools/client/framework/browser-menus.js
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-12 10:49:08 -0400
committerGitHub <noreply@github.com>2018-04-12 10:49:08 -0400
commita0968fc6a86c8ab1abfa83d3c1986fadf3ec2766 (patch)
tree15a948c5dfa339d8e28850a657078d39e50d354d /devtools/client/framework/browser-menus.js
parentfb337a69b484aca2240b7746627da445cc6e4e90 (diff)
parent912ac7e228e8ffc5b384cfda7de7b37e3e6e4b9a (diff)
downloadUXP-a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766.tar
UXP-a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766.tar.gz
UXP-a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766.tar.lz
UXP-a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766.tar.xz
UXP-a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766.zip
Merge pull request #127 from janekptacijarabaci/devtools_appmenu_3
[PALEMOON] [DevTools] Added support of the appmenu for DevTools menuitems (follow up)
Diffstat (limited to 'devtools/client/framework/browser-menus.js')
-rw-r--r--devtools/client/framework/browser-menus.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/devtools/client/framework/browser-menus.js b/devtools/client/framework/browser-menus.js
index a3ed17bbc..e62afddac 100644
--- a/devtools/client/framework/browser-menus.js
+++ b/devtools/client/framework/browser-menus.js
@@ -160,7 +160,8 @@ function createToolMenuElements(toolDefinition, doc) {
let appmenuitem = createMenuItem({
doc,
id: "appmenuitem_" + id,
- label: toolDefinition.menuLabel || toolDefinition.label
+ label: toolDefinition.menuLabel || toolDefinition.label,
+ accesskey: null
});
let menuitem = createMenuItem({
@@ -173,6 +174,7 @@ function createToolMenuElements(toolDefinition, doc) {
// Refer to the key in order to display the key shortcut at menu ends
menuitem.setAttribute("key", key.id);
}
+ appmenuitem.addEventListener("command", oncommand);
menuitem.addEventListener("command", oncommand);
return {
@@ -202,26 +204,26 @@ function insertToolMenuElements(doc, toolDefinition, prevDef) {
let amp;
if (prevDef) {
- let menuitem = doc.getElementById("appmenuitem_" + prevDef.id);
- ref = menuitem && menuitem.nextSibling ? menuitem.nextSibling : null;
+ let appmenuitem = doc.getElementById("appmenuitem_" + prevDef.id);
+ amp = appmenuitem && appmenuitem.nextSibling ? appmenuitem.nextSibling : null;
} else {
- ref = doc.getElementById("appmenu_devtools_separator");
+ amp = doc.getElementById("appmenu_devtools_separator");
}
- if (ref) {
- amp.parentNode.insertBefore(menuitem, ref);
+ if (amp) {
+ amp.parentNode.insertBefore(appmenuitem, amp);
}
- let ref;
+ let mp;
if (prevDef) {
let menuitem = doc.getElementById("menuitem_" + prevDef.id);
- ref = menuitem && menuitem.nextSibling ? menuitem.nextSibling : null;
+ mp = menuitem && menuitem.nextSibling ? menuitem.nextSibling : null;
} else {
- ref = doc.getElementById("menu_devtools_separator");
+ mp = doc.getElementById("menu_devtools_separator");
}
- if (ref) {
- ref.parentNode.insertBefore(menuitem, ref);
+ if (mp) {
+ mp.parentNode.insertBefore(menuitem, mp);
}
}
exports.insertToolMenuElements = insertToolMenuElements;