0
1
Fork 0
hedera-web-mindshore/js/htk/step/index.js

49 lines
793 B
JavaScript
Raw Normal View History

2022-06-06 12:49:18 +00:00
var Component = require('vn/component');
module.exports = new Class({
2022-06-06 12:49:18 +00:00
Extends: Component,
Tag: 'htk-step',
Properties: {
name: {
type: String,
value: null
},
validateFunc: {
type: Function,
value: null
},
showFunc: {
type: Function,
value: null
}
},
initialize: function(props) {
2022-06-06 16:02:17 +00:00
Component.prototype.initialize.call(this, props);
2022-06-06 17:13:57 +00:00
this.createRoot('div');
},
show: function() {
if (this.showFunc)
this.showFunc();
this.node.style.display = 'block';
},
hide: function() {
this.node.style.display = 'none';
},
validate: function() {
if (this.validateFunc)
return this.validateFunc();
return true;
},
appendChild: function(child) {
2022-06-06 12:49:18 +00:00
if (child instanceof Component)
child = child.node;
this.node.appendChild(child);
}
});