Ox.LoadingScreen: use proper LoadingIcon, add start and stop methods

This commit is contained in:
rolux 2013-11-20 09:10:37 +01:00
parent e1134f2f4c
commit 3429ac3319

View file

@ -35,11 +35,8 @@ Ox.LoadingScreen = function(options, self) {
setSizes();
$('<img>')
.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;
};