mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-11 10:25:46 +01:00
Fix localization bug.
This commit is contained in:
@@ -135,7 +135,16 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
get menuItems() {
|
get menuItems() {
|
||||||
|
function dispatch(node, name) {
|
||||||
|
let event = node.ownerDocument.createEvent("Events");
|
||||||
|
event.initEvent(name, false, false);
|
||||||
|
node.dispatchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
function addChildren(node, parent) {
|
function addChildren(node, parent) {
|
||||||
|
if (~["menu", "menupopup"].indexOf(node.localName) && node.children.length)
|
||||||
|
dispatch(node, "popupshowing");
|
||||||
|
|
||||||
for (let [, item] in Iterator(node.childNodes)) {
|
for (let [, item] in Iterator(node.childNodes)) {
|
||||||
if (item.childNodes.length == 0 && item.localName == "menuitem"
|
if (item.childNodes.length == 0 && item.localName == "menuitem"
|
||||||
&& !item.hidden
|
&& !item.hidden
|
||||||
@@ -2118,7 +2127,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
description: function (item) item.getAttribute("label"),
|
description: function (item) item.getAttribute("label"),
|
||||||
highlight: function (item) item.disabled ? "Disabled" : ""
|
highlight: function (item) item.disabled ? "Disabled" : ""
|
||||||
};
|
};
|
||||||
context.completions = dactyl.menuItems;
|
context.generate = function () dactyl.menuItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
var toolbox = document.getElementById("navigator-toolbox");
|
var toolbox = document.getElementById("navigator-toolbox");
|
||||||
|
|||||||
@@ -1481,8 +1481,7 @@ var Events = Module("events", {
|
|||||||
modes.push(modes.MENU);
|
modes.push(modes.MENU);
|
||||||
},
|
},
|
||||||
|
|
||||||
popuphidden: function onPopupHidden() {
|
popuphidden: function onPopupHidden(event) {
|
||||||
// gContextMenu is set to NULL, when a context menu is closed
|
|
||||||
if (window.gContextMenu == null && !this._activeMenubar)
|
if (window.gContextMenu == null && !this._activeMenubar)
|
||||||
modes.remove(modes.MENU, true);
|
modes.remove(modes.MENU, true);
|
||||||
modes.remove(modes.AUTOCOMPLETE);
|
modes.remove(modes.AUTOCOMPLETE);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ var Messages = Module("messages", {
|
|||||||
function getter(key, default_) function getter() messages.get([name, key].join("."), default_);
|
function getter(key, default_) function getter() messages.get([name, key].join("."), default_);
|
||||||
|
|
||||||
if (value != null) {
|
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))
|
if (!isObject(value))
|
||||||
value = messages.get(name, value);
|
value = messages.get(name, value);
|
||||||
else if (isArray(value))
|
else if (isArray(value))
|
||||||
|
|||||||
Reference in New Issue
Block a user