From 1bee0f3f4d14d6c354831e9fa1ae8853b7b2d24b Mon Sep 17 00:00:00 2001 From: Andrey Bobukh Date: Wed, 20 Aug 2014 14:23:04 +0300 Subject: [PATCH] Pass changed attrs as parameter to "validated:*" events --- src/backbone-validation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backbone-validation.js b/src/backbone-validation.js index 4e1da56a..96c6e9be 100644 --- a/src/backbone-validation.js +++ b/src/backbone-validation.js @@ -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.