2022-06-06 08:53:59 +00:00
|
|
|
require('./style.scss');
|
2022-06-06 12:49:18 +00:00
|
|
|
var Component = require('vn/component');
|
2022-06-06 08:53:59 +00:00
|
|
|
|
|
|
|
module.exports = new Class({
|
2022-06-06 12:49:18 +00:00
|
|
|
Extends: Component
|
2022-06-06 08:53:59 +00:00
|
|
|
,Tag: 'htk-spinner'
|
|
|
|
|
|
|
|
,_started: false
|
|
|
|
|
|
|
|
,render: function() {
|
|
|
|
var loader = this.createRoot('div');
|
|
|
|
|
|
|
|
var spin = this.spin = this.createElement('div');
|
|
|
|
loader.appendChild(spin);
|
|
|
|
}
|
|
|
|
|
|
|
|
,start: function() {
|
|
|
|
if (this._started)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Vn.Node.addClass(this.spin, 'spinner');
|
|
|
|
this._started = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
,stop: function() {
|
|
|
|
if (!this._started)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Vn.Node.removeClass(this.spin, 'spinner');
|
|
|
|
this._started = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|