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:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user