mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 11:15:47 +01:00
Add AUTOCOMPLETE mode.
This commit is contained in:
@@ -1258,7 +1258,11 @@ var Events = Module("events", {
|
|||||||
|
|
||||||
popupshown: function onPopupShown(event) {
|
popupshown: function onPopupShown(event) {
|
||||||
let elem = event.originalTarget;
|
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 (Events.isHidden(elem)) {
|
||||||
if (elem.hidePopup && Events.isHidden(elem.parentNode))
|
if (elem.hidePopup && Events.isHidden(elem.parentNode))
|
||||||
elem.hidePopup();
|
elem.hidePopup();
|
||||||
@@ -1271,6 +1275,7 @@ var Events = Module("events", {
|
|||||||
// 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, true);
|
modes.remove(modes.MENU, true);
|
||||||
|
modes.remove(modes.AUTOCOMPLETE);
|
||||||
},
|
},
|
||||||
|
|
||||||
resize: function onResize(event) {
|
resize: function onResize(event) {
|
||||||
|
|||||||
@@ -118,6 +118,11 @@ var Modes = Module("modes", {
|
|||||||
input: true,
|
input: true,
|
||||||
ownsFocus: 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", {
|
this.addMode("EMBED", {
|
||||||
input: true,
|
input: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user