fixed dbl-fillOptions in bz-select
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
<header><canvas data-output="agentSampleCanvas"></canvas></header>
|
||||
<section>
|
||||
<bz-select label="Agent type..." data-output="agentsSelector"></bz-select>
|
||||
<bz-toggler></bz-toggler>
|
||||
</section>
|
||||
</article>
|
||||
<article eiccard>
|
||||
@@ -27,8 +26,8 @@
|
||||
</section>
|
||||
</article>
|
||||
<article eiccard="">
|
||||
<header><h1>Agent properties</h1></header>
|
||||
<section>Props form</section>
|
||||
<header><h1>Agent properties</h1></header>
|
||||
<section data-output="agentProperties"></section>
|
||||
</article>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -52,6 +52,7 @@ class KeyframeView extends WindozDomContent {
|
||||
}
|
||||
|
||||
fillAgentProperties(agentProps){
|
||||
let allFields = []
|
||||
for(const propName in agentProps){
|
||||
const fieldRow = ui.create(`<div class="cols-2"><label>${propName}</label></div>`)
|
||||
let component
|
||||
@@ -77,16 +78,18 @@ class KeyframeView extends WindozDomContent {
|
||||
break
|
||||
case 'list':
|
||||
component = document.createElement('bz-select')
|
||||
console.log('choices', agentProps[propName].choices)
|
||||
// component.fillOptions( agentProps[propName].choices.map(item => {
|
||||
// return({ markup: `${item}`, value: item})
|
||||
// }))
|
||||
component.fillOptions( agentProps[propName].choices.map(item => {
|
||||
return({ markup: `${item}`, value: item})
|
||||
}))
|
||||
break
|
||||
default:
|
||||
console.warn(`Unknown field type ${agentProps[propName].type}`)
|
||||
}
|
||||
fieldRow.append(component)
|
||||
allFields.push(fieldRow)
|
||||
}
|
||||
this.outputs.agentProperties.innerHTML=''
|
||||
this.outputs.agentProperties.append(...allFields)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user