browsers dont like hidden animated svgs, brings down cpu usage to 0 if nothing happens

This commit is contained in:
j 2011-08-11 12:56:24 +02:00
parent f9360db0b4
commit 7cdf3dff7f

View file

@ -17,7 +17,7 @@ Ox.LoadingIcon = function(options, self) {
}) })
.options(options || {}) .options(options || {})
.attr({ .attr({
src: Ox.UI.getImageURL('symbolLoadingAnimated') src: Ox.UI.getImageURL('symbolLoading')
}) })
.addClass( .addClass(
'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size) 'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size)
@ -27,7 +27,10 @@ Ox.LoadingIcon = function(options, self) {
() -> <f> Loading Icon Element () -> <f> Loading Icon Element
@*/ @*/
that.start = function() { that.start = function() {
that.animate({ that.attr({
src: Ox.UI.getImageURL('symbolLoadingAnimated')
})
.animate({
opacity: 1 opacity: 1
}, 250); }, 250);
return that; return that;
@ -40,7 +43,10 @@ Ox.LoadingIcon = function(options, self) {
that.stop = function() { that.stop = function() {
that.animate({ that.animate({
opacity: 0 opacity: 0
}, 250); }, 250)
.attr({
src: Ox.UI.getImageURL('symbolLoading')
});
return that; return that;
}; };
return that; return that;