From 76ddf378dc0faa510cbe7e64e74894d715aedf14 Mon Sep 17 00:00:00 2001 From: Savo Date: Tue, 4 Jul 2017 18:51:45 +0200 Subject: [PATCH] Add support for Lodash 4.x --- dist/backbone-validation-amd.js | 10 +++++----- dist/backbone-validation.js | 10 +++++----- src/backbone-validation.js | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/backbone-validation-amd.js b/dist/backbone-validation-amd.js index 6f90e318..d49304ac 100644 --- a/dist/backbone-validation-amd.js +++ b/dist/backbone-validation-amd.js @@ -1,6 +1,6 @@ // Backbone.Validation v0.11.5 // -// Copyright (c) 2011-2015 Thomas Pedersen +// Copyright (c) 2011-2017 Thomas Pedersen // Distributed under MIT License // // Documentation and full license available at: @@ -257,8 +257,8 @@ 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); @@ -267,8 +267,8 @@ } else { options.valid(view, attr, options.selector); } - }, this); - }, this); + }, this)); + }, this)); } if(option === true) { diff --git a/dist/backbone-validation.js b/dist/backbone-validation.js index e1d10e10..e54ffd65 100644 --- a/dist/backbone-validation.js +++ b/dist/backbone-validation.js @@ -1,6 +1,6 @@ // Backbone.Validation v0.11.5 // -// Copyright (c) 2011-2015 Thomas Pedersen +// Copyright (c) 2011-2017 Thomas Pedersen // Distributed under MIT License // // Documentation and full license available at: @@ -250,8 +250,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); @@ -260,8 +260,8 @@ Backbone.Validation = (function(_){ } else { options.valid(view, attr, options.selector); } - }, this); - }, this); + }, this)); + }, this)); } if(option === true) { diff --git a/src/backbone-validation.js b/src/backbone-validation.js index e4aa8de2..f11a8b53 100644 --- a/src/backbone-validation.js +++ b/src/backbone-validation.js @@ -243,8 +243,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); @@ -253,8 +253,8 @@ Backbone.Validation = (function(_){ } else { options.valid(view, attr, options.selector); } - }, this); - }, this); + }, this)); + }, this)); } if(option === true) {