/www/jssrc/lib/OldSchoolSpinner.js
enyo.kind({
name: "OldSchoolSpinner",
kind: "Control",
style: "font-family: Inconsolata, Consolas, Fixedsys, fixed, monospace; font-size: 16px;",
content: '|',
steps: '/-\\|',
step: 0,
animationInterval: null,
destroy: function() {
this.stop();
this.inherited(arguments);
},
start: function() {
if (this.animationInterval)
return;
this.animationInterval = setInterval(this.animate.bind(this), 100);
},
stop: function() {
clearInterval(this.animationInterval);
this.animationInterval = null;
},
animate: function() {
this.step = (this.step + 1) % this.steps.length;
this.setContent(this.steps[this.step]);
}
});