2011-11-05 16:46:53 +00:00
|
|
|
'use strict';
|
2012-05-21 10:38:18 +00:00
|
|
|
|
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) {
|
2012-01-27 14:29:11 +00:00
|
|
|
|
2011-06-19 17:48:32 +00:00
|
|
|
self = self || {};
|
|
|
|
var that = Ox.Element('<img>', self)
|
2012-01-17 17:34:33 +00:00
|
|
|
.defaults({
|
|
|
|
size: 'medium'
|
|
|
|
})
|
|
|
|
.options(options || {})
|
|
|
|
.attr({
|
|
|
|
src: Ox.UI.getImageURL('symbolLoading')
|
|
|
|
})
|
|
|
|
.addClass(
|
|
|
|
'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size)
|
|
|
|
);
|
2012-01-27 14:29:11 +00:00
|
|
|
|
|
|
|
self.setOption = function(key, value) {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
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() {
|
2011-08-11 10:56:24 +00:00
|
|
|
that.attr({
|
|
|
|
src: Ox.UI.getImageURL('symbolLoadingAnimated')
|
|
|
|
})
|
|
|
|
.animate({
|
2011-04-22 22:03:10 +00:00
|
|
|
opacity: 1
|
|
|
|
}, 250);
|
|
|
|
return that;
|
|
|
|
};
|
2012-01-27 14:29:11 +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
|
2012-01-17 19:56:08 +00:00
|
|
|
}, 250, function() {
|
|
|
|
that.attr({
|
2012-01-17 17:34:33 +00:00
|
|
|
src: Ox.UI.getImageURL('symbolLoading')
|
|
|
|
});
|
|
|
|
});
|
2011-04-22 22:03:10 +00:00
|
|
|
return that;
|
2011-06-19 17:48:32 +00:00
|
|
|
};
|
2012-01-27 14:29:11 +00:00
|
|
|
|
2011-04-22 22:03:10 +00:00
|
|
|
return that;
|
2012-01-27 14:29:11 +00:00
|
|
|
|
2011-06-19 17:48:32 +00:00
|
|
|
};
|