Refactoring: Small html/variables changes

This commit is contained in:
Tobias Jordans 2021-09-30 21:41:21 +02:00
parent 29e7fea95a
commit 43618fe3f1

View file

@ -31,7 +31,7 @@ export default class CheckBoxes extends InputElement<number[]> {
} }
protected InnerConstructElement(): HTMLElement { protected InnerConstructElement(): HTMLElement {
const el = document.createElement("form"); const formTag = document.createElement("form");
const value = this.value; const value = this.value;
const elements = this._elements; const elements = this._elements;
@ -57,7 +57,7 @@ export default class CheckBoxes extends InputElement<number[]> {
"bg-red" "bg-red"
); );
const wrapper = document.createElement("span"); const wrapper = document.createElement("div");
wrapper.classList.add( wrapper.classList.add(
"wrapper", "wrapper",
"flex", "flex",
@ -68,7 +68,7 @@ export default class CheckBoxes extends InputElement<number[]> {
); );
wrapper.appendChild(input); wrapper.appendChild(input);
wrapper.appendChild(label); wrapper.appendChild(label);
el.appendChild(wrapper); formTag.appendChild(wrapper);
value.addCallbackAndRunD((selectedValues) => { value.addCallbackAndRunD((selectedValues) => {
if (selectedValues.indexOf(i) >= 0) { if (selectedValues.indexOf(i) >= 0) {
@ -97,6 +97,6 @@ export default class CheckBoxes extends InputElement<number[]> {
}; };
} }
return el; return formTag;
} }
} }