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

50 lines
793 B
JavaScript
Raw Normal View History

2022-06-06 08:53:59 +00:00
var Widget = require('../widget');
module.exports = new Class({
Extends: Widget,
Tag: 'htk-step',
Properties: {
name: {
type: String,
value: null
},
validateFunc: {
type: Function,
value: null
},
showFunc: {
type: Function,
value: null
}
},
initialize: function(props) {
var node = this.createRoot('div');
node.className = 'htk-step';
this.parent(props);
},
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) {
if (child instanceof Widget)
child = child.node;
this.node.appendChild(child);
}
});