diff --git a/UI/Input/DropDown.ts b/UI/Input/DropDown.ts index 86efd04..e8dca1c 100644 --- a/UI/Input/DropDown.ts +++ b/UI/Input/DropDown.ts @@ -14,10 +14,14 @@ export class DropDown extends InputElement { constructor(label: string | UIElement, values: { value: T, shown: string | UIElement }[], - value: UIEventSource = undefined) { + value: UIEventSource = undefined, + label_class: string, + select_class: string) { super(undefined); this._value = value ?? new UIEventSource(undefined); this._label = Translations.W(label); + this._label_class = label_class || ''; + this._select_class = select_class || ''; this._values = values.map(v => { return { value: v.value, @@ -29,10 +33,8 @@ export class DropDown extends InputElement { this.ListenTo(v.shown._source); } this.ListenTo(this._value); - - this.onClick(() => {}) // by registering a click, the click event is consumed and doesn't bubble furter to other elements, e.g. checkboxes - + this.onClick(() => {}) // by registering a click, the click event is consumed and doesn't bubble furter to other elements, e.g. checkboxes } GetValue(): UIEventSource { @@ -57,13 +59,13 @@ export class DropDown extends InputElement { for (let i = 0; i < this._values.length; i++) { options += "" } - return "
" + - "" + - "` + options + - "" + - "
"; + `` + + ``; } protected InnerUpdate(element) { diff --git a/UI/LanguagePicker.ts b/UI/LanguagePicker.ts index 304642a..2336a51 100644 --- a/UI/LanguagePicker.ts +++ b/UI/LanguagePicker.ts @@ -16,7 +16,7 @@ export default class LanguagePicker { return new DropDown(label, languages.map(lang => { return {value: lang, shown: lang} } - ), Locale.language); + ), Locale.language, 'sr-only', 'bg-indigo-100 p-1 rounded hover:bg-indigo-200'); }