修复BUG:所有编辑弹框validate后样式被保留

This commit is contained in:
Argo-Lenovo 2016-11-15 11:39:59 +08:00
parent 5554995884
commit 7ddae1a427
1 changed files with 5 additions and 3 deletions

View File

@ -33,9 +33,11 @@
if (this.options.modal && this.options.modal.constructor === String) { if (this.options.modal && this.options.modal.constructor === String) {
$('#' + this.options.modal).on('show.bs.modal', function (e) { $('#' + this.options.modal).on('show.bs.modal', function (e) {
if (that.options.validateForm.constructor === String) { if (that.options.validateForm.constructor === String) {
var v = $('#' + that.options.validateForm).validate(); var v = $('#' + that.options.validateForm);
v.currentElements.each(function () { $(this).popover('destroy'); }) var vf = v.validate();
v.resetForm(); vf.currentElements.each(function () { $(this).popover('destroy'); })
vf.resetForm();
v.find('div.form-group').removeClass("has-error has-success");
} }
}); });
} }