From e23fbb2d3541e88d544b35917127a4eeeeb3e1a1 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 20 Jun 2012 11:37:47 +0200 Subject: [PATCH] Ox.LoadingIcon: support passing a number as size --- source/Ox.UI/js/Core/LoadingIcon.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/Ox.UI/js/Core/LoadingIcon.js b/source/Ox.UI/js/Core/LoadingIcon.js index 2dbfb37b..15676ef0 100644 --- a/source/Ox.UI/js/Core/LoadingIcon.js +++ b/source/Ox.UI/js/Core/LoadingIcon.js @@ -4,7 +4,7 @@ Ox.LoadingIcon Loading Icon Element ([options[, self]]) -> Loading Icon Element options Options object - size size of icon + size size of icon self Shared private variable @*/ @@ -13,15 +13,15 @@ Ox.LoadingIcon = function(options, self) { self = self || {}; var that = Ox.Element('', 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 Start loading animation