merging changes

This commit is contained in:
rlx 2011-08-06 17:41:01 +00:00
commit 8e468ced0b
7 changed files with 31 additions and 14 deletions

View file

@ -6,6 +6,7 @@ Ox.IconItem <f:Ox.Element> IconItem Object
(options) -> <f> IconItem Object
(options, self) -> <f> IconItem Object
options <o> Options object
borderRadius <n|0> border radius for icon images
fixedRatio <b|n|false> if set to a number, icons have a fixed ratio
height <n|128> icon height
id <s> element id
@ -24,6 +25,7 @@ Ox.IconItem = function(options, self) {
self = self || {};
var that = Ox.Element({}, self)
.defaults({
borderRadius: 0,
fixedRatio: false,
height: 128,
id: '',
@ -64,7 +66,8 @@ Ox.IconItem = function(options, self) {
})
.css({
width: self.options.width + 'px',
height: self.options.height + 'px'
height: self.options.height + 'px',
borderRadius: self.options.borderRadius + 4 + 'px'
})
.mousedown(mousedown)
.mouseenter(mouseenter)
@ -103,7 +106,8 @@ Ox.IconItem = function(options, self) {
width: self.options.width + 'px',
height: self.options.height + 'px',
// firefox is 1px off when centering images with odd width and scaleY(-1)
paddingLeft: ($.browser.mozilla && self.options.width % 2 ? 1 : 0) + 'px'
paddingLeft: ($.browser.mozilla && self.options.width % 2 ? 1 : 0) + 'px',
borderRadius: self.options.borderRadius + 4 + 'px'
});
that.$gradient = $('<div>')
.css({

View file

@ -5,6 +5,7 @@ Ox.IconList <f:Ox.Element> IconList Object
(options) -> <f> IconList Object
(options, self) -> <f> IconList Object
options <o> Options object
borderRadius <n|0> border radius for icon images
centerSelection <b|false> scroll list so selection is always centered
defaultRatio <n|1> aspect ratio of icon placeholders
draggable <b|true> can be dragged
@ -29,6 +30,7 @@ Ox.IconList = function(options, self) {
self = self || {};
var that = Ox.Element({}, self)
.defaults({
borderRadius: 0,
centerSelection: false,
defaultRatio: 1,
draggable: true,
@ -91,6 +93,7 @@ Ox.IconList = function(options, self) {
self.options.item(data, self.options.sort, self.options.size) : {}
ratio = !isEmpty ? data.width / data.height : self.options.defaultRatio;
return self.options.itemConstructor($.extend(data, {
borderRadius: self.options.borderRadius,
fixedRatio: self.options.fixedRatio,
height: Math.round(self.options.size / (ratio <= 1 ? 1 : ratio)),
size: self.options.size,