unclean SPARC
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
class ComponentLabView extends EICDomContent {
|
||||
|
||||
|
||||
|
||||
DOMContentLoaded() {
|
||||
this.components = ui.eicfy(this.el);
|
||||
|
||||
this.tConfig = this.components.find(c => c.el.name == 'config');
|
||||
this.tData = this.components.find(c => c.el.name == 'data');
|
||||
this.btReset = this.components.find(c => c.el.classList.contains('button-update'));
|
||||
|
||||
this.reset(JSON.parse(this.tConfig.value), JSON.parse(this.tData.value));
|
||||
|
||||
this.btReset.addEventListener('click', this.onReset.bind(this));
|
||||
}
|
||||
|
||||
onReset(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
this.reset(JSON.parse(this.tConfig.value), JSON.parse(this.tData.value));
|
||||
}
|
||||
|
||||
reset(config, data) {
|
||||
this.map = new StateChart(this.find('.relation-map'), config)
|
||||
|
||||
this.map.data = data;
|
||||
this.map.click = this.testBadge.bind(this)
|
||||
}
|
||||
|
||||
testBadge(entity) {
|
||||
entity.badge = 23
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('ComponentLabView',ComponentLabView);
|
||||
|
||||
Reference in New Issue
Block a user