misc fixes

This commit is contained in:
rlx 2011-09-29 17:25:50 +00:00
commit 8ea49fab73
10 changed files with 41 additions and 16 deletions

View file

@ -64,8 +64,9 @@ Ox.IconItem = function(options, self) {
}
that.css({
width: self.options.itemWidth + 'px',
height: self.options.itemHeight + 'px'
// 2 * 2 px margin (.css), 2 * 2 px border (here)
width: self.options.itemWidth + 4 + 'px',
height: self.options.itemHeight + + 4 + 'px'
});
that.$icon = $('<div>')
.addClass('OxIcon')

View file

@ -18,7 +18,7 @@ Ox.IconList <f:Ox.Element> IconList Object
keys <a|[]> available item keys
max <n|-1> maximum selected selected items
min <n|0> minimum of selcted items
orientation <s|both> list orientation
orientation <s|both> orientation ("horizontal", "vertical" or "both")
selected <a|[]> array of selected items
size <n|128> list size
sort <a|[]> sort keys

View file

@ -19,7 +19,7 @@ Ox.List <f:Ox.Element> List Element
keys <a|[]> keys of the list items
max <n|-1> Maximum number of items that can be selected (-1 for all)
min <n|0> Minimum number of items that must be selected
orientation <s|vertical> 'horizontal' or 'vertical'
orientation <s|vertical> 'horizontal', 'vertical' or 'both'
pageLength <n|100> number of items per page
selected <a|[]> ids of the selected elements
sort <a|[]> sort order
@ -120,9 +120,9 @@ Ox.List = function(options, self) {
key_control_v: pasteItems,
key_control_x: cutItems,
key_delete: deleteItems,
key_end: scrollToFirst,
key_end: scrollToLast,
key_enter: open,
key_home: scrollToLast,
key_home: scrollToFirst,
key_pagedown: scrollPageDown,
key_pageup: scrollPageUp,
key_section: preview, // fixme: firefox gets keyCode 0 when pressing space
@ -1158,7 +1158,7 @@ Ox.List = function(options, self) {
function setSelected(ids, callback) {
// fixme: no case where callback is set
// fixme: can't use selectNone here,
// note: can't use selectNone here,
// since it'd trigger a select event
var counter = 0;
self.$items.forEach(function($item, pos) {
@ -1650,7 +1650,9 @@ Ox.List = function(options, self) {
value <s> value, can be whatever that property is
@*/
that.value = function(id, key, value) {
var pos = getPositionById(id),
// id can be a number and will then be interpreted as position
Ox.print('that.value id key value', id, key, value)
var pos = Ox.isNumber(id) ? id : getPositionById(id),
$item = self.$items[pos],
data = $item.options('data');
if (arguments.length == 1) {