summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/content/dactyl.js11
-rw-r--r--common/content/events.js3
-rw-r--r--common/modules/messages.jsm2
3 files changed, 12 insertions, 4 deletions
diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index e218da30..ba45d395 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -135,7 +135,16 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}),
get menuItems() {
+ function dispatch(node, name) {
+ let event = node.ownerDocument.createEvent("Events");
+ event.initEvent(name, false, false);
+ node.dispatchEvent(event);
+ }
+
function addChildren(node, parent) {
+ if (~["menu", "menupopup"].indexOf(node.localName) && node.children.length)
+ dispatch(node, "popupshowing");
+
for (let [, item] in Iterator(node.childNodes)) {
if (item.childNodes.length == 0 && item.localName == "menuitem"
&& !item.hidden
@@ -2118,7 +2127,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
description: function (item) item.getAttribute("label"),
highlight: function (item) item.disabled ? "Disabled" : ""
};
- context.completions = dactyl.menuItems;
+ context.generate = function () dactyl.menuItems;
};
var toolbox = document.getElementById("navigator-toolbox");
diff --git a/common/content/events.js b/common/content/events.js
index 28ebc50b..5f42d22c 100644
--- a/common/content/events.js
+++ b/common/content/events.js
@@ -1481,8 +1481,7 @@ var Events = Module("events", {
modes.push(modes.MENU);
},
- popuphidden: function onPopupHidden() {
- // gContextMenu is set to NULL, when a context menu is closed
+ popuphidden: function onPopupHidden(event) {
if (window.gContextMenu == null && !this._activeMenubar)
modes.remove(modes.MENU, true);
modes.remove(modes.AUTOCOMPLETE);
diff --git a/common/modules/messages.jsm b/common/modules/messages.jsm
index e5b03faf..f1f4de13 100644
--- a/common/modules/messages.jsm
+++ b/common/modules/messages.jsm
@@ -108,7 +108,7 @@ var Messages = Module("messages", {
function getter(key, default_) function getter() messages.get([name, key].join("."), default_);
if (value != null) {
- let name = [this.constructor.className.toLowerCase(), this.identifier || this.name, prop].join(".");
+ var name = [this.constructor.className.toLowerCase(), this.identifier || this.name, prop].join(".");
if (!isObject(value))
value = messages.get(name, value);
else if (isArray(value))