ares-ide
Version:
A browser-based code editor and UI designer for Enyo 2 projects
32 lines (29 loc) • 1 kB
JavaScript
/**
A control that displays a spinner animation to indicate that activity is
taking place. By default, onyx.Spinner will display a light spinner,
suitable for displaying against a dark background. To render a dark spinner
to be shown on a lighter background, add the "onyx-light" class to the
spinner:
{kind: "onyx.Spinner", classes: "onyx-light"}
Typically, a spinner is shown to indicate activity and hidden to indicate
that the activity has ended. The spinner animation will automatically start
when a spinner is shown. If you wish, you may control the animation directly
by calling the *start*, *stop*, and *toggle* methods.
*/
enyo.kind({
name: "onyx.Spinner",
classes: "onyx-spinner",
//* @public
//* Stops the spinner animation.
stop: function() {
this.setShowing(false);
},
//* Starts the spinner animation.
start: function() {
this.setShowing(true);
},
//* Toggles the spinner animation on or off.
toggle: function() {
this.setShowing(!this.getShowing());
}
});