Browse Source

#226: Fix the conflict issue with MooTools

nghuuphuoc 11 years ago
parent
commit
5db4b9a9bd

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@
 * The [```zipCode``` validator](http://bootstrapvalidator.com/validators/zipCode/) adds support for Italian, Dutch postcodes
 * [#245](https://github.com/nghuuphuoc/bootstrapvalidator/pull/245): The [```cvv``` validator](http://bootstrapvalidator.com/validators/cvv/) should support spaces in credit card, thanks to [@evilchili](https://github.com/evilchili)
 * Change default ```submitButtons``` to ```[type="submit"]``` to support ```input type="submit"```
+* [#226](https://github.com/nghuuphuoc/bootstrapvalidator/issues/226): Fix the conflict issue with MooTools
 * [#238](https://github.com/nghuuphuoc/bootstrapvalidator/issues/238): The submit buttons are not sent
 * Fix the issue that the hidden fields generated by other plugins might not be validated
 * When parsing options from HTML attributes, don't add the field which hasn't validators. It improves fixes for [#191](https://github.com/nghuuphuoc/bootstrapvalidator/issues/191), [#223](https://github.com/nghuuphuoc/bootstrapvalidator/issues/223)

+ 2 - 1
dist/js/bootstrapValidator.js

@@ -404,7 +404,8 @@
          */
         _isExcluded: function($field) {
             if (this.options.excluded) {
-                for (var i in this.options.excluded) {
+                var length = this.options.excluded.length;
+                for (var i = 0; i < length; i++) {
                     if (('string' == typeof this.options.excluded[i] && $field.is(this.options.excluded[i]))
                         || ('function' == typeof this.options.excluded[i] && this.options.excluded[i].call(this, $field, this) == true))
                     {

File diff suppressed because it is too large
+ 1 - 1
dist/js/bootstrapValidator.min.js


+ 2 - 1
src/js/bootstrapValidator.js

@@ -403,7 +403,8 @@
          */
         _isExcluded: function($field) {
             if (this.options.excluded) {
-                for (var i in this.options.excluded) {
+                var length = this.options.excluded.length;
+                for (var i = 0; i < length; i++) {
                     if (('string' == typeof this.options.excluded[i] && $field.is(this.options.excluded[i]))
                         || ('function' == typeof this.options.excluded[i] && this.options.excluded[i].call(this, $field, this) == true))
                     {