1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:07:58 +01:00

MOW context menu stuff.

This commit is contained in:
Kris Maglione
2012-01-03 20:04:58 -05:00
parent a53ce209be
commit 8592247b1a

View File

@@ -282,9 +282,12 @@ var CommandWidgets = Class("CommandWidgets", {
contextMenu: Class.Memoize(function () {
["copy", "copylink", "selectall"].forEach(function (tail) {
// some host apps use "hostPrefixContext-copy" ids
let xpath = "//xul:menuitem[contains(@id, '" + "ontext-" + tail + "') and not(starts-with(@id, 'dactyl-'))]";
document.getElementById("dactyl-context-" + tail).style.listStyleImage =
DOM(DOM.XPath(xpath, document).snapshotItem(0)).style.listStyleImage;
let css = "menuitem[id$='ontext-" + tail + "']:not([id^=dactyl-])";
let style = DOM(css, document).style;
DOM("#dactyl-context-" + tail, document).css({
listStyleImage: style.listStyleImage,
MozImageRegion: style.MozImageRegion
});
});
return document.getElementById("dactyl-contextmenu");
}),