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

42 lines
628 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
var Widget = require ('./widget');
module.exports = new Class
2015-11-19 13:57:23 +00:00
({
2016-09-26 09:28:47 +00:00
Extends: Widget
2015-11-19 13:57:23 +00:00
,Tag: 'htk-spinner'
2016-05-02 13:05:49 +00:00
,_started: false
2015-11-19 13:57:23 +00:00
,initialize: function (props)
{
var loader = this.createElement ('div');
loader.className = 'htk-spinner';
var spin = document.createElement ('div');
loader.appendChild (spin);
this.spin = spin;
this.parent (props);
}
,start: function ()
{
2016-05-02 13:05:49 +00:00
if (!this._started)
{
Vn.Node.addClass (this.spin, 'spinner');
this._started = true;
}
2015-11-19 13:57:23 +00:00
}
,stop: function ()
{
2016-05-02 13:05:49 +00:00
if (this._started)
{
Vn.Node.removeClass (this.spin, 'spinner');
this._started = false;
}
2015-11-19 13:57:23 +00:00
}
});
2016-09-26 09:28:47 +00:00