修改BUG:Longbow.Validate增加过滤.ignore组件

This commit is contained in:
Argo-MacBookPro 2018-08-06 17:36:32 +08:00
parent 9545c1230c
commit 7d309d1a15
1 changed files with 4 additions and 5 deletions

View File

@ -101,8 +101,8 @@
}
});
if (this.options.modal) {
$(this.options.modal).on('show.bs.modal', function (e) {
that.reset();
$(this.options.modal).on('show.bs.modal', function (e) {
that.reset();
});
}
};
@ -112,14 +112,13 @@
Validate.DEFAULTS = {
validClass: 'is-valid',
errorClass: 'is-invalid',
ignoreClass: '.ignore',
childClass: '[data-valid="true"]',
validResult: 'data-valid-result'
};
Validate.prototype.defaults = function () {
return $.extend(Validate.DEFAULTS, {
validClass: this.$element.attr('data-validclass'),
errorClass: this.$element.attr('data-errorclass'),
validButtons: this.$element.attr('data-valid-button'),
modal: this.$element.attr('data-valid-modal')
});
@ -139,7 +138,7 @@
var op = this.options;
var $firstElement = null;
this.$element.find(this.options.childClass + ':visible').each(function () {
this.$element.find(op.childClass + ':visible').not(op.ignoreClass).each(function () {
if (!that.validElement(this) && $firstElement == null) $firstElement = $(this);
});
if ($firstElement) $firstElement.tooltip('show');