Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Forms.methods({
form.doc(propertyName, propertyValue);
});
var updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
return ['documentChange', updatedDoc, changes];
return ['documentChange', updatedDoc, changes, form];
})
, invalidate: makeEventTrigger(function (propertyName, errors) {
var form = this;
Expand All @@ -321,12 +321,12 @@ Forms.methods({
form.errors(errors);
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
updatedErrors = Tracker.nonreactive(function () { return form.errors(); });
return ['documentInvalid', updatedDoc, updatedErrors];
return ['documentInvalid', updatedDoc, updatedErrors, form];
} else {
form.errors(propertyName, errors);
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
updatedErrors = Tracker.nonreactive(function () { return form.errors(propertyName); });
return ['propertyInvalid', updatedDoc, updatedErrors];
return ['propertyInvalid', updatedDoc, updatedErrors, form];
}
})
, validate: makeEventTrigger(function (propertyName) {
Expand Down Expand Up @@ -365,14 +365,14 @@ Forms.methods({
if (errors.length) {
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
updatedErrors = Tracker.nonreactive(function () { return form.errors(); });
return ['documentInvalid', updatedDoc, updatedErrors];
return ['documentInvalid', updatedDoc, updatedErrors, form];
}
} else {
form.errors(propertyName, errors);
if (errors.length) {
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
updatedErrors = Tracker.nonreactive(function () { return form.errors(propertyName); });
return ['propertyInvalid', updatedDoc, updatedErrors];
return ['propertyInvalid', updatedDoc, updatedErrors, form];
}
}
return null;
Expand All @@ -383,9 +383,9 @@ Forms.methods({
var updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
var updatedErrors = Tracker.nonreactive(function () { return form.errors(); });
if (updatedErrors.length) {
return ['documentInvalid', updatedDoc, updatedErrors];
return ['documentInvalid', updatedDoc, updatedErrors, form];
} else {
return ['documentSubmit', updatedDoc];
return ['documentSubmit', updatedDoc, form];
}
})
});
Expand Down