1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 23:44:11 +01:00

Don't close the completion list when leaving command-line mode (e.g., opening the context menu). Fix :pageinfo (which currently lacks a unit test).

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-29 01:41:24 -05:00
parent 09f3541a76
commit a3fa68042b
3 changed files with 26 additions and 17 deletions

View File

@@ -172,13 +172,14 @@ var MOW = Module("mow", {
},
contextEvents: {
popupshowing: function (event) {
let menu = commandline.widgets.contextMenu;
let enabled = {
link: window.document.popupNode instanceof HTMLAnchorElement,
path: window.document.popupNode.hasAttribute("path"),
selection: !window.document.commandDispatcher.focusedWindow.getSelection().isCollapsed
};
for (let node in array.iterValues(event.target.children)) {
for (let node in array.iterValues(menu.children)) {
let group = node.getAttributeNS(NS, "group");
node.hidden = group && !group.split(/\s+/).every(function (g) enabled[g]);
}