1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-19 22:17:59 +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 () { DOMMenuBarInactive: function () {
this._activeMenubar = false; this._activeMenubar = false;
modes.remove(modes.MENU); modes.remove(modes.MENU, true);
}, },
blur: function onBlur(event) { blur: function onBlur(event) {
@@ -1244,7 +1244,7 @@ var Events = Module("events", {
popuphidden: function onPopupHidden() { popuphidden: function onPopupHidden() {
// gContextMenu is set to NULL, when a context menu is closed // 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); modes.remove(modes.MENU, true);
}, },
resize: function onResize(event) { resize: function onResize(event) {

View File

@@ -155,7 +155,15 @@ var Modes = Module("modes", {
this.addMode("MENU", { this.addMode("MENU", {
description: "Active when a menu or other pop-up is open", description: "Active when a menu or other pop-up is open",
input: true, 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", { this.addMode("LINE", {
@@ -260,8 +268,13 @@ var Modes = Module("modes", {
commandline.widgets.mode = msg || null; commandline.widgets.mode = msg || null;
}, },
remove: function remove(mode) { remove: function remove(mode, covert) {
if (this.stack.some(function (m) m.main == mode)) { 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(mode);
this.pop(); this.pop();
} }