浏览代码

#175: Fix issue on IE8, don't use array.indexOf

nghuuphuoc 11 年之前
父节点
当前提交
be189475b3
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      dist/js/bootstrapValidator.js
  2. 1 1
      dist/js/bootstrapValidator.min.js
  3. 2 2
      src/js/bootstrapValidator.js

+ 2 - 2
dist/js/bootstrapValidator.js

@@ -293,9 +293,9 @@
                 $parent   = $field.parents('.form-group'),
                 // Allow user to indicate where the error messages are shown
                 container = this.options.fields[field].container || this.options.container,
-                $message  = (container && ['tooltip', 'popover'].indexOf(container) == -1) ? $(container) : this._getMessageContainer($field);
+                $message  = (container && container != 'tooltip' && container != 'popover') ? $(container) : this._getMessageContainer($field);
 
-            if (container && ['tooltip', 'popover'].indexOf(container) == -1) {
+            if (container && container != 'tooltip' && container != 'popover') {
                 $message.addClass('has-error');
             }
 

文件差异内容过多而无法显示
+ 1 - 1
dist/js/bootstrapValidator.min.js


+ 2 - 2
src/js/bootstrapValidator.js

@@ -292,9 +292,9 @@
                 $parent   = $field.parents('.form-group'),
                 // Allow user to indicate where the error messages are shown
                 container = this.options.fields[field].container || this.options.container,
-                $message  = (container && ['tooltip', 'popover'].indexOf(container) == -1) ? $(container) : this._getMessageContainer($field);
+                $message  = (container && container != 'tooltip' && container != 'popover') ? $(container) : this._getMessageContainer($field);
 
-            if (container && ['tooltip', 'popover'].indexOf(container) == -1) {
+            if (container && container != 'tooltip' && container != 'popover') {
                 $message.addClass('has-error');
             }