ArrayInput: add 'isEmpty' option

This commit is contained in:
rolux 2015-02-14 19:09:51 +00:00
parent e97b4ee922
commit 35b0c46eac

View file

@ -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);
});
};