mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
refactor(generation): cultures start
This commit is contained in:
parent
1a57a8ac08
commit
fe20f66b96
15 changed files with 621 additions and 581 deletions
|
|
@ -30,6 +30,13 @@ export function setInputValue(id: string, value: string | number | boolean) {
|
|||
($element as HTMLInputElement).value = String(value);
|
||||
}
|
||||
|
||||
export function getSelectedOption(id: string) {
|
||||
const $element = byId(id);
|
||||
if (!$element) throw new Error(`Element ${id} not found`);
|
||||
|
||||
return ($element as HTMLSelectElement).selectedOptions[0];
|
||||
}
|
||||
|
||||
// apply drop-down menu option. If the value is not in options, add it
|
||||
export function applyDropdownOption($select: HTMLSelectElement, value: string, name = value) {
|
||||
const isExisting = Array.from($select.options).some(o => o.value === value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue