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
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,render() {
|
2022-06-06 08:53:59 +00:00
|
|
|
var loader = this.createRoot('div');
|
|
|
|
|
|
|
|
var spin = this.spin = this.createElement('div');
|
|
|
|
loader.appendChild(spin);
|
|
|
|
}
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,start() {
|
2022-06-06 08:53:59 +00:00
|
|
|
if (this._started)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Vn.Node.addClass(this.spin, 'spinner');
|
|
|
|
this._started = true;
|
|
|
|
}
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,stop() {
|
2022-06-06 08:53:59 +00:00
|
|
|
if (!this._started)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Vn.Node.removeClass(this.spin, 'spinner');
|
|
|
|
this._started = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|