Ox.LoadingIcon: support passing a number as size

This commit is contained in:
rolux 2012-06-20 11:37:47 +02:00
parent ccc7c86713
commit e23fbb2d35

View file

@ -4,7 +4,7 @@
Ox.LoadingIcon <f> Loading Icon Element
([options[, self]]) -> <o:Ox.Element> Loading Icon Element
options <o> Options object
size <s|medium> size of icon
size <n|s|16> size of icon
self <o> Shared private variable
@*/
@ -13,15 +13,15 @@ Ox.LoadingIcon = function(options, self) {
self = self || {};
var that = Ox.Element('<img>', self)
.defaults({
size: 'medium'
size: 16
})
.options(options || {})
.attr({
src: Ox.UI.getImageURL('symbolLoading')
})
.addClass(
'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size)
);
.addClass('OxLoadingIcon')
.attr({src: Ox.UI.getImageURL('symbolLoading')});
Ox.isNumber(self.options.size)
? that.css({width: self.options.size, height: self.options.size})
: that.addClass('Ox' + Ox.toTitleCase(self.options.size));
/*@
start <f> Start loading animation