1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-15 18:54:11 +01:00

Add AUTOCOMPLETE mode.

This commit is contained in:
Kris Maglione
2011-02-17 10:11:04 -05:00
parent c5da372a3f
commit 7b1c40cf5f
2 changed files with 11 additions and 1 deletions

View File

@@ -1258,7 +1258,11 @@ var Events = Module("events", {
popupshown: function onPopupShown(event) {
let elem = event.originalTarget;
if (elem.localName !== "tooltip" && elem.id !== "dactyl-visualbell")
if (elem instanceof Ci.nsIAutoCompletePopup) {
if (modes.main != modes.AUTOCOMPLETE)
modes.push(modes.AUTOCOMPLETE);
}
else if (elem.localName !== "tooltip")
if (Events.isHidden(elem)) {
if (elem.hidePopup && Events.isHidden(elem.parentNode))
elem.hidePopup();
@@ -1271,6 +1275,7 @@ var Events = Module("events", {
// gContextMenu is set to NULL, when a context menu is closed
if (window.gContextMenu == null && !this._activeMenubar)
modes.remove(modes.MENU, true);
modes.remove(modes.AUTOCOMPLETE);
},
resize: function onResize(event) {

View File

@@ -118,6 +118,11 @@ var Modes = Module("modes", {
input: true,
ownsFocus: true
});
this.addMode("AUTOCOMPLETE", {
description: "Active when an input autocomplete pop-up is active",
display: function () "INSERT (autocomplete)",
bases: [this.INSERT]
});
this.addMode("EMBED", {
input: true,