Skip to content

Commit

Permalink
Use _.bind instead of relying in context arg (lodash 4 support). thed…
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Américo committed Apr 21, 2018
1 parent e25e693 commit 88c49fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backbone-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ Backbone.Validation = (function(_){
if (attrs) {
flattened = flatten(this.attributes);
//Loop through all associated views
_.each(this.associatedViews, function(view) {
_.each(attrs, function (attr) {
_.each(this.associatedViews, _.bind(function(view) {
_.each(attrs, _.bind(function (attr) {
error = validateAttr(this, attr, flattened[attr], _.extend({}, this.attributes));
if (error) {
options.invalid(view, attr, error, options.selector);
Expand All @@ -248,8 +248,8 @@ Backbone.Validation = (function(_){
} else {
options.valid(view, attr, options.selector);
}
}, this);
}, this);
}, this));
}, this));
}

if(option === true) {
Expand Down

0 comments on commit 88c49fe

Please sign in to comment.