oxjs/source/UI/js/Bar/Bar.js

29 lines
825 B
JavaScript
Raw Normal View History

2011-11-05 17:46:53 +01:00
'use strict';
2011-05-16 10:24:46 +02:00
/*@
2012-05-31 12:32:54 +02:00
Ox.Bar <f> Bar
2011-05-16 10:24:46 +02:00
options <o> Options object
2012-06-21 23:15:54 +02:00
orientation <s|'horizontal'> Orientation ('horizontal' or 'vertical')
size <n|s|'medium'> can be 'small', 'medium', 'large' or number
2011-05-16 10:24:46 +02:00
self <o> Shared private variable
([options[, self]]) -> <o:Ox.Element> Bar object
2011-05-16 10:24:46 +02:00
@*/
2011-04-23 00:03:10 +02:00
Ox.Bar = function(options, self) {
2014-09-25 12:05:22 +02:00
self = self || {};
var that = Ox.Element({}, self)
2011-04-23 00:03:10 +02:00
.defaults({
orientation: 'horizontal',
2014-09-25 12:05:22 +02:00
size: 16
2011-04-23 00:03:10 +02:00
})
.options(options || {})
2014-09-25 12:05:22 +02:00
.addClass('OxBar Ox' + Ox.toTitleCase(self.options.orientation));
2014-09-26 14:18:11 +02:00
self.dimensions = Ox.UI.DIMENSIONS[self.options.orientation];
2014-09-25 12:05:22 +02:00
that.css(self.dimensions[0], '100%')
.css(self.dimensions[1], self.options.size + 'px');
2011-04-23 00:03:10 +02:00
return that;
2014-09-25 12:05:22 +02:00
2011-04-23 00:03:10 +02:00
};