diff --git a/lib/forms.js b/lib/forms.js index 561b66c..93bc9ea 100644 --- a/lib/forms.js +++ b/lib/forms.js @@ -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; @@ -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) { @@ -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; @@ -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]; } }) });