convert some tabs to spaces
This commit is contained in:
parent
4818a7d617
commit
3ea3600a23
1 changed files with 35 additions and 35 deletions
|
@ -42,42 +42,42 @@ Ox.Form = function(options, self) {
|
|||
self.itemIds[i] = item.options('id') || item.id;
|
||||
self.$items[i] = Ox.FormItem({element: item}).appendTo(that);
|
||||
item.bindEvent({
|
||||
autovalidate: function(data) {
|
||||
validateForm(i, data.valid);
|
||||
data.valid && self.$items[i].setMessage('');
|
||||
},
|
||||
/*
|
||||
// fixme: should't inputs also trigger a change event?
|
||||
blur: function(data) {
|
||||
that.triggerEvent('change', {
|
||||
id: self.itemIds[i],
|
||||
data: data
|
||||
});
|
||||
},
|
||||
*/
|
||||
change: function(data) {
|
||||
// fixme: shouldn't this be key/value instead of id/data?
|
||||
that.triggerEvent('change', {
|
||||
id: self.itemIds[i],
|
||||
data: data
|
||||
});
|
||||
validateItem(i, function(valid) {
|
||||
validateForm(i, valid);
|
||||
});
|
||||
},
|
||||
submit: function(data) {
|
||||
self.formIsValid && that.submit();
|
||||
},
|
||||
validate: function(data) {
|
||||
validateForm(i, data.valid);
|
||||
// timeout needed for cases where the form is removed
|
||||
// from the DOM, triggering blur of an empty item -
|
||||
// in this case, we don't want the message to appear
|
||||
setTimeout(function() {
|
||||
autovalidate: function(data) {
|
||||
validateForm(i, data.valid);
|
||||
data.valid && self.$items[i].setMessage('');
|
||||
},
|
||||
/*
|
||||
// fixme: should't inputs also trigger a change event?
|
||||
blur: function(data) {
|
||||
that.triggerEvent('change', {
|
||||
id: self.itemIds[i],
|
||||
data: data
|
||||
});
|
||||
},
|
||||
*/
|
||||
change: function(data) {
|
||||
// fixme: shouldn't this be key/value instead of id/data?
|
||||
that.triggerEvent('change', {
|
||||
id: self.itemIds[i],
|
||||
data: data
|
||||
});
|
||||
validateItem(i, function(valid) {
|
||||
validateForm(i, valid);
|
||||
});
|
||||
},
|
||||
submit: function(data) {
|
||||
self.formIsValid && that.submit();
|
||||
},
|
||||
validate: function(data) {
|
||||
validateForm(i, data.valid);
|
||||
// timeout needed for cases where the form is removed
|
||||
// from the DOM, triggering blur of an empty item -
|
||||
// in this case, we don't want the message to appear
|
||||
setTimeout(function() {
|
||||
self.$items[i].setMessage(data.valid ? '' : data.message);
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
self.formIsValid = self.options.validate(self.itemIsValid);
|
||||
|
|
Loading…
Reference in a new issue