1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-08 22:24:11 +01:00

Allow binding keys in "menu" modes.

This commit is contained in:
Kris Maglione
2010-12-25 19:45:05 -05:00
parent dca9f2df86
commit 1c9d1b2548
3 changed files with 12 additions and 7 deletions

View File

@@ -1168,9 +1168,9 @@ var CommandLine = Module("commandline", {
availableHeight -= extra || 0;
doc.body.style.minWidth = this.widgets.commandbar.commandline.scrollWidth + "px";
this.widgets.mowContainer.height = Math.min(doc.height, availableHeight) + "px";
this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px";
this.timeout(function ()
this.widgets.mowContainer.height = Math.min(doc.height, availableHeight) + "px",
this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px",
0);
doc.body.style.minWidth = "";

View File

@@ -106,7 +106,8 @@ var Events = Module("events", {
*/
wrapListener: function wrapListener(method, self) {
self = self || this;
return function wrappedListener(event) {
method.wrapped = wrappedListener;
function wrappedListener(event) {
try {
method.apply(self, arguments);
}
@@ -118,6 +119,7 @@ var Events = Module("events", {
dactyl.echoerr("Processing " + event.type + " event: " + (e.echoerr || e));
}
};
return wrappedListener;
},
/**
@@ -865,11 +867,13 @@ var Events = Module("events", {
this._input = null;
if (!input) {
let ignore = false;
let overrideMode = null;
// menus have their own command handlers
if (modes.extended & modes.MENU)
ignore = true;
else if (modes.main == modes.PASS_THROUGH)
overrideMode = modes.MENU;
if (modes.main == modes.PASS_THROUGH)
ignore = !Events.isEscape(key) && key != "<C-v>";
else if (modes.main == modes.QUOTE) {
if (modes.getStack(1).main == modes.PASS_THROUGH) {
@@ -896,7 +900,7 @@ var Events = Module("events", {
if (key in config.ignoreKeys && (config.ignoreKeys[key] & mode.main))
return null;
input = Events.KeyProcessor(mode.params.mainMode || mode.main, mode.extended);
input = Events.KeyProcessor(overrideMode || mode.params.mainMode || mode.main, mode.extended);
if (mode.params.preExecute)
input.preExecute = mode.params.preExecute;
if (mode.params.postExecute)

View File

@@ -68,7 +68,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
__noSuchMethod__: function (meth, args) {
let win = util.activeWindow;
var dactyl = global && global.dactyl || win && win.dactyl;
if (!win)
if (!dactyl)
return null;
let prop = dactyl[meth];
@@ -102,6 +102,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
}
catch (e) {}
}
Class.replaceProperty(obj, "observe",
function (subject, target, data) {
try {