update ArrayInput
This commit is contained in:
parent
944d4036b0
commit
4f77725a74
1 changed files with 6 additions and 3 deletions
|
@ -56,8 +56,7 @@ Ox.ArrayInput = function(options, self) {
|
|||
.appendTo(self.$element[i]));
|
||||
focus && self.$input[i].focusInput();
|
||||
self.$removeButton.splice(i, 0, Ox.Button({
|
||||
disabled: self.$input.length == 1,
|
||||
title: 'remove',
|
||||
title: self.$input.length == 1 ? 'close' : 'remove',
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'left', marginLeft: '8px'})
|
||||
|
@ -68,8 +67,12 @@ Ox.ArrayInput = function(options, self) {
|
|||
self.$input[index].options({value: ''});
|
||||
that.triggerEvent('change', {value: that.value()});
|
||||
}
|
||||
if (self.$input.length == 1) {
|
||||
self.$input[0].focusInput();
|
||||
} else {
|
||||
removeInput(index);
|
||||
}
|
||||
}
|
||||
})
|
||||
.appendTo(self.$element[i]));
|
||||
self.$addButton.splice(i, 0, Ox.Button({
|
||||
|
|
Loading…
Reference in a new issue