Skip to content

Commit 176d251

Browse files
committed
Form is passed as the final argument to event handlers
1 parent 2bac7ff commit 176d251

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/forms.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Forms.methods({
306306
form.doc(propertyName, propertyValue);
307307
});
308308
var updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
309-
return ['documentChange', updatedDoc, changes];
309+
return ['documentChange', updatedDoc, changes, form];
310310
})
311311
, invalidate: makeEventTrigger(function (propertyName, errors) {
312312
var form = this;
@@ -321,12 +321,12 @@ Forms.methods({
321321
form.errors(errors);
322322
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
323323
updatedErrors = Tracker.nonreactive(function () { return form.errors(); });
324-
return ['documentInvalid', updatedDoc, updatedErrors];
324+
return ['documentInvalid', updatedDoc, updatedErrors, form];
325325
} else {
326326
form.errors(propertyName, errors);
327327
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
328328
updatedErrors = Tracker.nonreactive(function () { return form.errors(propertyName); });
329-
return ['propertyInvalid', updatedDoc, updatedErrors];
329+
return ['propertyInvalid', updatedDoc, updatedErrors, form];
330330
}
331331
})
332332
, validate: makeEventTrigger(function (propertyName) {
@@ -365,14 +365,14 @@ Forms.methods({
365365
if (errors.length) {
366366
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
367367
updatedErrors = Tracker.nonreactive(function () { return form.errors(); });
368-
return ['documentInvalid', updatedDoc, updatedErrors];
368+
return ['documentInvalid', updatedDoc, updatedErrors, form];
369369
}
370370
} else {
371371
form.errors(propertyName, errors);
372372
if (errors.length) {
373373
updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
374374
updatedErrors = Tracker.nonreactive(function () { return form.errors(propertyName); });
375-
return ['propertyInvalid', updatedDoc, updatedErrors];
375+
return ['propertyInvalid', updatedDoc, updatedErrors, form];
376376
}
377377
}
378378
return null;
@@ -383,9 +383,9 @@ Forms.methods({
383383
var updatedDoc = Tracker.nonreactive(function () { return form.doc(); });
384384
var updatedErrors = Tracker.nonreactive(function () { return form.errors(); });
385385
if (updatedErrors.length) {
386-
return ['documentInvalid', updatedDoc, updatedErrors];
386+
return ['documentInvalid', updatedDoc, updatedErrors, form];
387387
} else {
388-
return ['documentSubmit', updatedDoc];
388+
return ['documentSubmit', updatedDoc, form];
389389
}
390390
})
391391
});

0 commit comments

Comments
 (0)