mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge pull request #291 from Pax1601/main
Minor fixes (merging from main)
This commit is contained in:
@@ -33,8 +33,8 @@ export class Dropdown {
|
||||
this.#options.classList.add("ol-scrollable");
|
||||
}
|
||||
|
||||
setOptions(optionsList: string[]) {
|
||||
this.#optionsList = optionsList;
|
||||
setOptions(optionsList: string[], sortAlphabetically: boolean = true) {
|
||||
this.#optionsList = optionsList.sort();
|
||||
this.#options.replaceChildren(...optionsList.map((option: string, idx: number) => {
|
||||
var div = document.createElement("div");
|
||||
var button = document.createElement("button");
|
||||
@@ -70,6 +70,7 @@ export class Dropdown {
|
||||
var el = document.createElement("div");
|
||||
el.classList.add("ol-ellipsed");
|
||||
el.innerText = option;
|
||||
this.#value.replaceChildren();
|
||||
this.#value.appendChild(el);
|
||||
this.#index = idx;
|
||||
this.#close();
|
||||
|
||||
@@ -188,8 +188,6 @@ export class MapContextMenu extends ContextMenu {
|
||||
this.#resetGroundUnitType();
|
||||
|
||||
const types = groundUnitsDatabase.getByRole(role).map((blueprint) => { return blueprint.label });
|
||||
types.sort();
|
||||
|
||||
this.#groundUnitTypeDropdown.setOptions(types);
|
||||
this.#groundUnitTypeDropdown.selectValue(0);
|
||||
this.clip();
|
||||
@@ -202,8 +200,6 @@ export class MapContextMenu extends ContextMenu {
|
||||
this.#groundUnitTypeDropdown.reset();
|
||||
|
||||
const roles = groundUnitsDatabase.getRoles();
|
||||
roles.sort();
|
||||
|
||||
this.#groundUnitRoleDropdown.setOptions(roles);
|
||||
this.clip();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export class LogPanel extends Panel
|
||||
if (parseInt(idx) >= this.#logs.length) {
|
||||
this.#logs.push(logs[idx]);
|
||||
var el = document.createElement("div");
|
||||
el.innerHTML = logs[idx];
|
||||
el.innerText = logs[idx];
|
||||
el.classList.add("js-log-element", "ol-log-element");
|
||||
this.getElement().appendChild(el);
|
||||
this.getElement().scrollTop = this.getElement().scrollHeight;
|
||||
|
||||
Reference in New Issue
Block a user