0
1
Fork 0
hedera-web-mindshore/js/htk/spinner.js

39 lines
583 B
JavaScript

var Widget = require ('./widget');
module.exports = new Class
({
Extends: Widget
,Tag: 'htk-spinner'
,_started: false
,render: function ()
{
var loader = this.createRoot ('div');
loader.className = 'htk-spinner';
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;
}
});