Ox.Bar: get rid of Ox.UI.getBarSize

This commit is contained in:
rlx 2014-09-25 12:05:22 +02:00
parent 6a5c380795
commit 10415a6ae2

View file

@ -8,18 +8,21 @@ Ox.Bar <f> Bar
([options[, self]]) -> <o:Ox.Element> Bar object ([options[, self]]) -> <o:Ox.Element> Bar object
@*/ @*/
Ox.Bar = function(options, self) { Ox.Bar = function(options, self) {
self = self || {}; self = self || {};
var that = Ox.Element({}, self) var that = Ox.Element({}, self)
.defaults({ .defaults({
orientation: 'horizontal', orientation: 'horizontal',
size: 'medium' size: 16
}) })
.options(options || {}) .options(options || {})
.addClass('OxBar Ox' + Ox.toTitleCase(self.options.orientation)), .addClass('OxBar Ox' + Ox.toTitleCase(self.options.orientation));
dimensions = Ox.UI.DIMENSIONS[self.options.orientation];
self.options.size = Ox.isString(self.options.size) self.dimensions = Ox.UI.DIMENSIONS[self.options.orientation];
? Ox.UI.getBarSize(self.options.size) : self.options.size;
that.css(dimensions[0], '100%') that.css(self.dimensions[0], '100%')
.css(dimensions[1], self.options.size + 'px'); .css(self.dimensions[1], self.options.size + 'px');
return that; return that;
}; };