1
0
Fork 0
forked from 0x2620/oxjs

improving listmap

This commit is contained in:
rolux 2011-05-22 14:39:57 +02:00
commit 5915acd72c
12 changed files with 152 additions and 39 deletions

View file

@ -131,7 +131,12 @@ Ox.ArrayInput = function(options, self) {
}
self.setOption = function(key, value) {
if (key == 'width') {
if (key == 'value') {
return Ox.map(self.$input, function($input) {
var value = $input.value();
return value === '' ? null : value;
});
} else if (key == 'width') {
setWidths();
}
}

View file

@ -65,7 +65,7 @@ Ox.Form = function(options, self) {
});
});
function getItemPositionById(id) {
function getItemIndexById(id) {
return self.itemIds.indexOf(id);
}
@ -121,8 +121,10 @@ Ox.Form = function(options, self) {
//Ox.print('VALUES', values)
return values;
} else {
Ox.each(arguments[0], function(val, key) {
Ox.forEach(arguments[0], function(value, key) {
var index = getItemIndexById(key);
index > -1 && Ox.print(key, value)
index > -1 && self.options.items[index].options({value: value});
});
return that;
}

View file

@ -789,8 +789,10 @@ Ox.Input = function(options, self) {
} else if (key == 'placeholder') {
setPlaceholder();
} else if (key == 'value') {
val = self.$input.val(); // fixme: ??
self.$input.val(value);
if (self.options.type == 'float' && self.options.decimals) {
self.options.value = self.options.value.toFixed(self.options.decimals);
}
self.$input.val(self.options.value);
setPlaceholder();
} else if (key == 'width') {
that.css({width: self.options.width + 'px'});

View file

@ -26,7 +26,7 @@ Ox.Select = function(options, self) {
// fixme: selected item needs attribute "checked", not "selected" ... that's strange
var self = self || {},
that = new Ox.Element({
tooltip: options.tooltip || {}
tooltip: options.tooltip || ''
}, self) // fixme: do we use 'div', or {}, or '', by default?
.defaults({
id: '',