Skip to content

Commit

Permalink
Pass changed attrs as parameter to "validated:*" events
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Bobukh committed Aug 20, 2014
1 parent 08d01da commit 1bee0f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backbone-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ Backbone.Validation = (function(_){
// Need to defer this so the model is actually updated before
// the event is triggered.
_.defer(function() {
model.trigger('validated', model._isValid, model, result.invalidAttrs);
model.trigger('validated:' + (model._isValid ? 'valid' : 'invalid'), model, result.invalidAttrs);
model.trigger('validated', model._isValid, model, result.invalidAttrs, changedAttrs);
model.trigger('validated:' + (model._isValid ? 'valid' : 'invalid'), model, result.invalidAttrs, changedAttrs);
});

// Return any error messages to Backbone, unless the forceUpdate flag is set.
Expand Down

0 comments on commit 1bee0f3

Please sign in to comment.