tolerant to string true/false

This commit is contained in:
dcore94 2023-10-09 13:31:31 +02:00
parent 22ea7a3d55
commit 49407a59a0
1 changed files with 2 additions and 2 deletions

View File

@ -407,7 +407,7 @@ class CCPBooleanInputWidgetController extends CCPBaseInputWidgetController{
if(this.value.length <= 1){
return `
<div class="my-2 form-check form-switch form-check-inline">
<input data-index="0" value="${this.value.length ? this.value[0] : false}" class="my-2 form-check-input" type="checkbox" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${this.value[0] === true ? 'checked' : ''} value="${ this.value[0]}"/>
<input data-index="0" value="${this.value.length ? this.value[0] : false}" class="my-2 form-check-input" type="checkbox" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${this.value[0] == true ? 'checked' : ''} value="${ this.value[0]}"/>
</div>
`
}
@ -415,7 +415,7 @@ class CCPBooleanInputWidgetController extends CCPBaseInputWidgetController{
this.value.map((c,i)=>{
return `
<div class="my-2 form-check form-switch form-check-inline">
<input data-index="${i}" value="${c}" class="my-2 form-check-input" type="checkbox" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${c === true ? 'checked' : ''} value="${this.value[i]}"/>
<input data-index="${i}" value="${c}" class="my-2 form-check-input" type="checkbox" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${c == true ? 'checked' : ''} value="${this.value[i]}"/>
</div>
`
}).join("\n")