1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 05:54:12 +01:00

Fix localization bug.

This commit is contained in:
Kris Maglione
2011-07-29 13:46:34 -04:00
parent efb4ae78ba
commit 9f057a6f0d
3 changed files with 12 additions and 4 deletions

View File

@@ -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");