2011-04-23 16:45:50 +00:00
|
|
|
// vim: et:ts=4:sw=4:sts=4:ft=js
|
2011-05-16 08:24:46 +00:00
|
|
|
/*@
|
|
|
|
Ox.LoadingIcon <f:Ox.Element> Loading Icon Element
|
|
|
|
() -> <f> Loading Icon Element
|
|
|
|
(options) -> <f> Loading Icon Element
|
|
|
|
(options, self) -> <f> Loading Icon Element
|
|
|
|
options <o> Options object
|
|
|
|
size <s|medium> size of icon
|
|
|
|
self <o> Shared private variable
|
|
|
|
@*/
|
|
|
|
|
2011-04-22 22:03:10 +00:00
|
|
|
Ox.LoadingIcon = function(options, self) {
|
|
|
|
var self = self || {},
|
2011-04-29 12:40:51 +00:00
|
|
|
that = new Ox.Element('<img>', self)
|
2011-04-22 22:03:10 +00:00
|
|
|
.defaults({
|
|
|
|
size: 'medium'
|
|
|
|
})
|
|
|
|
.options(options || {})
|
|
|
|
.attr({
|
|
|
|
src: Ox.UI.getImagePath('symbolLoading.svg')
|
|
|
|
})
|
|
|
|
.addClass(
|
|
|
|
'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size)
|
|
|
|
);
|
2011-05-16 08:24:46 +00:00
|
|
|
/*@
|
|
|
|
start <f> Start loading animation
|
|
|
|
() -> <f> Loading Icon Element
|
|
|
|
@*/
|
2011-04-22 22:03:10 +00:00
|
|
|
that.start = function() {
|
|
|
|
that.animate({
|
|
|
|
opacity: 1
|
|
|
|
}, 250);
|
|
|
|
return that;
|
|
|
|
};
|
2011-05-16 10:49:48 +00:00
|
|
|
|
2011-05-16 08:24:46 +00:00
|
|
|
/*@
|
|
|
|
stop <f> Stop loading animation
|
|
|
|
() -> <f> Loading Icon Element
|
|
|
|
@*/
|
2011-04-22 22:03:10 +00:00
|
|
|
that.stop = function() {
|
|
|
|
that.animate({
|
|
|
|
opacity: 0
|
|
|
|
}, 250);
|
|
|
|
return that;
|
|
|
|
}
|
|
|
|
return that;
|
|
|
|
}
|