Follow, tankers and AWACS completed

This commit is contained in:
Pax1601
2023-04-19 16:30:14 +02:00
parent f24c57cc18
commit c3c84b2115
5 changed files with 68 additions and 21 deletions

View File

@@ -24,9 +24,10 @@ export class Dropdown {
this.#clip();
});
this.#element.addEventListener("mouseleave", ev => {
this.#close();
});
// Commented out since it is a bit frustrating, particularly when the dropdown opens towards the top and not to the bottom
//this.#element.addEventListener("mouseleave", ev => {
// this.#close();
//});
}
setOptions(optionsList: string[])
@@ -61,7 +62,10 @@ export class Dropdown {
this.#index = idx;
this.#close();
this.#callback(option);
return true;
}
else
return false;
}
reset() {
@@ -73,6 +77,12 @@ export class Dropdown {
return this.#value.innerText;
}
setValue(value: string) {
var index = this.#optionsList.findIndex((option) => {return option === value});
if (index > -1)
this.selectValue(index);
}
getIndex() {
return this.#index;
}