浏览代码

Add status.field.bv event triggered after updating the field status (#300, #301)

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

+ 1 - 0
CHANGELOG.md

@@ -4,6 +4,7 @@
 
 * [#121](https://github.com/nghuuphuoc/bootstrapvalidator/issues/121): Add events for form validate successfully or not
 * [#195](https://github.com/nghuuphuoc/bootstrapvalidator/issues/195): Add events for field validation
+* Add ```status.field.bv``` event which is triggered after updating the field status. It can be used to solve [#300](https://github.com/nghuuphuoc/bootstrapvalidator/issues/300), [#301](https://github.com/nghuuphuoc/bootstrapvalidator/issues/301)
 * [#164](https://github.com/nghuuphuoc/bootstrapvalidator/issues/164): Add ```container``` option for indicating the element showing all errors
 * [#175](https://github.com/nghuuphuoc/bootstrapvalidator/issues/175): Showing errors in tooltip or popover
 * [#211](https://github.com/nghuuphuoc/bootstrapvalidator/issues/211), [#235](https://github.com/nghuuphuoc/bootstrapvalidator/issues/235): Add new method ```getInvalidFields()``` that returns all invalid fields

+ 3 - 0
dist/js/bootstrapValidator.js

@@ -877,6 +877,9 @@
                     break;
             }
 
+            // Trigger the "status.field.bv" event
+            this.$form.trigger($.Event('status.field.bv'), [field, $field, status]);
+
             this._onValidateFieldCompleted($field);
 
             return this;

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


+ 3 - 0
src/js/bootstrapValidator.js

@@ -876,6 +876,9 @@
                     break;
             }
 
+            // Trigger the "status.field.bv" event
+            this.$form.trigger($.Event('status.field.bv'), [field, $field, status]);
+
             this._onValidateFieldCompleted($field);
 
             return this;