ArrayInput: add 'isEmpty' option
This commit is contained in:
parent
e97b4ee922
commit
35b0c46eac
1 changed files with 5 additions and 3 deletions
|
@ -20,7 +20,10 @@ Ox.ArrayInput = function(options, self) {
|
|||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
getInput: null,
|
||||
getInput: Ox.Input,
|
||||
isEmpty: function(value) {
|
||||
return value === '';
|
||||
},
|
||||
label: '',
|
||||
max: 0,
|
||||
setWidth: null,
|
||||
|
@ -34,7 +37,6 @@ Ox.ArrayInput = function(options, self) {
|
|||
width: setWidths
|
||||
});
|
||||
|
||||
self.options.getInput = self.options.getInput || Ox.Input;
|
||||
self.options.value = self.options.value || [];
|
||||
|
||||
if (self.options.label) {
|
||||
|
@ -138,7 +140,7 @@ Ox.ArrayInput = function(options, self) {
|
|||
return Ox.map(self.$input, function($input) {
|
||||
return $input.value();
|
||||
}).filter(function(value) {
|
||||
return value !== '';
|
||||
return !self.options.isEmpty(value);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue