1
0
Fork 0
forked from 0x2620/oxjs

improve listmap editing functionality

This commit is contained in:
rolux 2011-05-24 12:44:34 +02:00
commit 02442a24f7
6 changed files with 81 additions and 56 deletions

View file

@ -132,9 +132,14 @@ Ox.ArrayInput = function(options, self) {
self.setOption = function(key, value) {
if (key == 'value') {
return Ox.map(self.$input, function($input) {
var value = $input.value();
return value === '' ? null : value;
if (self.options.value.length == 0) {
self.options.value = [''];
}
self.$input && self.$input.forEach(function($input, i) {
removeInput(i);
});
self.options.value.forEach(function(value, i) {
addInput(i, value);
});
} else if (key == 'width') {
setWidths();