ソースを参照

Fix #325: the threshold option doesn't work on IE 8

nghuuphuoc 11 年 前
コミット
7939ca8f5a

+ 1 - 0
CHANGELOG.md

@@ -30,6 +30,7 @@
 * [#313](https://github.com/nghuuphuoc/bootstrapvalidator/issues/313): Fix the [```file``` validator](http://bootstrapvalidator.com/validators/file/) issue on IE 8
 * [#314](https://github.com/nghuuphuoc/bootstrapvalidator/issues/314): The [```creditCard``` validator](http://bootstrapvalidator.com/validators/creditCard/) doesn't work on IE 8
 * [#315](https://github.com/nghuuphuoc/bootstrapvalidator/issues/315): The [```cvv``` validator](http://bootstrapvalidator.com/validators/cvv/) doesn't work on IE 8
+* [#325](https://github.com/nghuuphuoc/bootstrapvalidator/issues/325): The [```threshold``` option](http://bootstrapvalidator.com/settings/#threshold) doesn't work on IE 8
 * [#259](https://github.com/nghuuphuoc/bootstrapvalidator/issues/259): Typo "Support almost Bootstrap forms"
 * [#261](https://github.com/nghuuphuoc/bootstrapvalidator/pull/261): English fix to 'amazing contributors' section, thanks to [@lloydde](https://github.com/lloydde)
 * [#278](https://github.com/nghuuphuoc/bootstrapvalidator/pull/278): Update [```choice``` validator](http://bootstrapvalidator.com/validators/choice/) document, thanks to [@MrC0mm0n](https://github.com/MrC0mm0n)

+ 1 - 2
dist/js/bootstrapValidator.js

@@ -489,8 +489,7 @@
             if (!threshold) {
                 return true;
             }
-            var type       = $field.attr('type'),
-                cannotType = ['button', 'checkbox', 'file', 'hidden', 'image', 'radio', 'reset', 'submit'].indexOf(type) != -1;
+            var cannotType = $.inArray($field.attr('type'), ['button', 'checkbox', 'file', 'hidden', 'image', 'radio', 'reset', 'submit']) != -1;
             return (cannotType || $field.val().length >= threshold);
         },
         

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/js/bootstrapValidator.min.js


+ 1 - 2
src/js/bootstrapValidator.js

@@ -488,8 +488,7 @@
             if (!threshold) {
                 return true;
             }
-            var type       = $field.attr('type'),
-                cannotType = ['button', 'checkbox', 'file', 'hidden', 'image', 'radio', 'reset', 'submit'].indexOf(type) != -1;
+            var cannotType = $.inArray($field.attr('type'), ['button', 'checkbox', 'file', 'hidden', 'image', 'radio', 'reset', 'submit']) != -1;
             return (cannotType || $field.val().length >= threshold);
         },