From b2ccf06b950b7b669d1a341fd67d329e9dea5c1d Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 9 Jan 2015 16:25:12 -0500 Subject: [PATCH] Remove proxy calls from form --- src/definitions/behaviors/form.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 43edacdec..0075d4573 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -375,7 +375,7 @@ $.fn.form = function(fields, parameters) { if(allValid) { module.debug('Form has no validation errors, submitting'); module.set.success(); - return $.proxy(settings.onSuccess, element)(event); + return settings.onSuccess.call(element, event); } else { module.debug('Form has errors'); @@ -387,7 +387,7 @@ $.fn.form = function(fields, parameters) { if($module.data('moduleApi') !== undefined) { event.stopImmediatePropagation(); } - return $.proxy(settings.onFailure, element)(formErrors); + return settings.onFailure.call(element, formErrors); } }, @@ -417,12 +417,12 @@ $.fn.form = function(fields, parameters) { } if(fieldValid) { module.remove.prompt(field, fieldErrors); - $.proxy(settings.onValid, $field)(); + settings.onValid.call($field); } else { formErrors = formErrors.concat(fieldErrors); module.add.prompt(field.identifier, fieldErrors); - $.proxy(settings.onInvalid, $field)(fieldErrors); + settings.onInvalid.call($field, fieldErrors); return false; } return true; @@ -445,11 +445,11 @@ $.fn.form = function(fields, parameters) { if(bracket !== undefined && bracket !== null) { ancillary = '' + bracket[1]; functionType = type.replace(bracket[0], ''); - isValid = $.proxy(settings.rules[functionType], element)(value, ancillary); + isValid = settings.rules[functionType].call(element, value, ancillary); } // normal notation else { - isValid = $.proxy(settings.rules[type], $field)(value); + isValid = settings.rules[type].call($field, value); } return isValid; }