forked from verdnatura/hedera-web
34 lines
568 B
JavaScript
34 lines
568 B
JavaScript
require('./style.scss');
|
|
var Component = require('vn/component');
|
|
|
|
module.exports = new Class({
|
|
Extends: Component
|
|
,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;
|
|
}
|
|
});
|
|
|