sim creation wired to DB with ownership
This commit is contained in:
@@ -8,8 +8,8 @@ class CreateSimView extends WindozDomContent {
|
||||
async DOMContentLoaded(options) {
|
||||
this.models = options.models
|
||||
const components = ui.eicfy(this.el)
|
||||
this.setupTriggers(components)
|
||||
this.setupRefs(components)
|
||||
|
||||
this.models.keyframes.list('', null).then(data => data.payload).then(kflist => {
|
||||
this.outputs.keyframesSelector.fillOptions(kflist.map(item => {
|
||||
return({
|
||||
@@ -18,12 +18,16 @@ class CreateSimView extends WindozDomContent {
|
||||
})
|
||||
}))
|
||||
})
|
||||
this.outputs.keyframesSelector.addEventListener('change', this.onChangeKeyframe.bind(this))
|
||||
}
|
||||
|
||||
onChangeKeyframe(event) {
|
||||
onCreateSim(comp, event) {
|
||||
if(!this.outputs.keyframesSelector.value) return
|
||||
// TODO: use selected keyframe for simulation creation
|
||||
if(!this.outputs.simName.value) return
|
||||
this.models.sims.create({
|
||||
kfId: this.outputs.keyframesSelector.value,
|
||||
simName: this.outputs.simName.value
|
||||
}).then(data => ui.growl.append('Simulation created!','success',3000))
|
||||
this.unload()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user