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

Fix "Edit Element Style", "New Attribute", etc. in Firebug.

This commit is contained in:
Kris Maglione
2011-02-14 14:30:26 -05:00
parent 69c9a9e485
commit a42d29385a
2 changed files with 18 additions and 5 deletions

View File

@@ -1013,7 +1013,7 @@ var Events = Module("events", {
DOMMenuBarInactive: function () {
this._activeMenubar = false;
modes.remove(modes.MENU);
modes.remove(modes.MENU, true);
},
blur: function onBlur(event) {
@@ -1244,7 +1244,7 @@ var Events = Module("events", {
popuphidden: function onPopupHidden() {
// gContextMenu is set to NULL, when a context menu is closed
if (window.gContextMenu == null && !this._activeMenubar)
modes.remove(modes.MENU);
modes.remove(modes.MENU, true);
},
resize: function onResize(event) {

View File

@@ -155,7 +155,15 @@ var Modes = Module("modes", {
this.addMode("MENU", {
description: "Active when a menu or other pop-up is open",
input: true,
passthrough: true
passthrough: true,
ownsInput: false
}, {
leave: function leave(stack) {
util.timeout(function () {
if (stack.pop && !modes.main.input && !Events.isInputElement(dactyl.focusedElement));
modes.push(modes.INSERT);
});
}
});
this.addMode("LINE", {
@@ -260,8 +268,13 @@ var Modes = Module("modes", {
commandline.widgets.mode = msg || null;
},
remove: function remove(mode) {
if (this.stack.some(function (m) m.main == mode)) {
remove: function remove(mode, covert) {
if (covert && this.topOfStack.main != mode) {
util.assert(mode != this.NORMAL);
for (let m; m = array.nth(this.modeStack, function (m) m.main == mode, 0);)
this._modeStack.splice(this._modeStack.indexOf(m));
}
else if (this.stack.some(function (m) m.main == mode)) {
this.pop(mode);
this.pop();
}