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