From 7cdf3dff7f577518b82c7c02c9fa50b526337c9f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 11 Aug 2011 12:56:24 +0200 Subject: [PATCH] browsers dont like hidden animated svgs, brings down cpu usage to 0 if nothing happens --- source/Ox.UI/js/Core/Ox.LoadingIcon.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Core/Ox.LoadingIcon.js b/source/Ox.UI/js/Core/Ox.LoadingIcon.js index 2acdcb1a..a0b3bacf 100644 --- a/source/Ox.UI/js/Core/Ox.LoadingIcon.js +++ b/source/Ox.UI/js/Core/Ox.LoadingIcon.js @@ -17,7 +17,7 @@ Ox.LoadingIcon = function(options, self) { }) .options(options || {}) .attr({ - src: Ox.UI.getImageURL('symbolLoadingAnimated') + src: Ox.UI.getImageURL('symbolLoading') }) .addClass( 'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size) @@ -27,7 +27,10 @@ Ox.LoadingIcon = function(options, self) { () -> Loading Icon Element @*/ that.start = function() { - that.animate({ + that.attr({ + src: Ox.UI.getImageURL('symbolLoadingAnimated') + }) + .animate({ opacity: 1 }, 250); return that; @@ -40,7 +43,10 @@ Ox.LoadingIcon = function(options, self) { that.stop = function() { that.animate({ opacity: 0 - }, 250); + }, 250) + .attr({ + src: Ox.UI.getImageURL('symbolLoading') + }); return that; }; return that;