mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add support for multiple menu locations
This commit is contained in:
parent
80b3c5016d
commit
089efbe57e
2 changed files with 8 additions and 7 deletions
|
|
@ -4,9 +4,9 @@ const MAX_AUTOCOMPLETE_NAME_LEN = 50;
|
|||
|
||||
class Autocomplete {
|
||||
constructor() {
|
||||
this.autocompleteList = [];
|
||||
this.autoSubmit = false;
|
||||
this.elements = [];
|
||||
this.started = false;
|
||||
this.index = -1;
|
||||
this.input = undefined;
|
||||
this.shadowRoot = undefined;
|
||||
|
|
@ -35,19 +35,17 @@ class Autocomplete {
|
|||
}
|
||||
|
||||
this.autoSubmit = autoSubmit;
|
||||
this.input = input;
|
||||
|
||||
if (!this.started) {
|
||||
input.addEventListener('click', ev => this.click(ev, this.input));
|
||||
if (!this.autocompleteList.includes(input)) {
|
||||
input.addEventListener('click', ev => this.click(ev, input));
|
||||
input.addEventListener('keydown', ev => this.keyPress(ev));
|
||||
input.setAttribute('autocomplete', 'off');
|
||||
this.autocompleteList.push(input);
|
||||
}
|
||||
|
||||
if (showListInstantly) {
|
||||
this.showList(input);
|
||||
}
|
||||
|
||||
this.started = true;
|
||||
}
|
||||
|
||||
mouseOver(e, div, item) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ CredentialAutocomplete.prototype.click = async function(e, input) {
|
|||
input.select();
|
||||
}
|
||||
|
||||
this.showList(input);
|
||||
const field = this.autocompleteList.find(a => a === input);
|
||||
if (field) {
|
||||
this.showList(field);
|
||||
}
|
||||
};
|
||||
|
||||
CredentialAutocomplete.prototype.itemClick = async function(e, item, input, uuid) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue