From 3429ac3319770c49eb21d5d41459a5352c78b259 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 20 Nov 2013 09:10:37 +0100 Subject: [PATCH] Ox.LoadingScreen: use proper LoadingIcon, add start and stop methods --- source/Ox.UI/js/Core/LoadingScreen.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Core/LoadingScreen.js b/source/Ox.UI/js/Core/LoadingScreen.js index f3b69723..025393f7 100644 --- a/source/Ox.UI/js/Core/LoadingScreen.js +++ b/source/Ox.UI/js/Core/LoadingScreen.js @@ -35,11 +35,8 @@ Ox.LoadingScreen = function(options, self) { setSizes(); - $('') - .attr({src: Ox.UI.getImageURL('symbolLoadingAnimated')}) - .css({ - width: self.options.size + 'px', - height: self.options.size + 'px' + self.$loadingIcon = Ox.LoadingIcon({ + size: self.options.size }) .appendTo(self.$box); @@ -68,6 +65,18 @@ Ox.LoadingScreen = function(options, self) { self.$box.css(css); } + that.start = function(callback) { + self.$loadingIcon.start(callback); + self.$text && self.$text.stop().animate({opacity: 1}, 250); + return that; + }; + + that.stop = function(callback) { + self.$loadingIcon.stop(callback); + self.$text && self.$text.stop().animate({opacity: 0}, 250); + return that; + }; + return that; }; \ No newline at end of file