修改BUG:移动模态窗口reset方法到longbow.valdiate内部实现

This commit is contained in:
Argo-MacBookPro 2018-08-04 14:33:45 +08:00
parent 1c99b4b235
commit cef69ba098
3 changed files with 8 additions and 10 deletions

View File

@ -30,7 +30,7 @@
@section modal {
<div class="modal fade" id="dialogNew" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content" data-toggle="LgbValidate" data-valid-button="#btnSubmit">
<div class="modal-content" data-toggle="LgbValidate" data-valid-button="#btnSubmit" data-valid-modal="#dialogNew">
@RenderSection("modal", false)
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">

View File

@ -26,13 +26,6 @@
}
// handler modal window show event
if (this.options.modal) {
$(this.options.modal).on('show.bs.modal', function (e) {
var $validator = $(this).find('[data-toggle="LgbValidate"]');
if ($.isFunction($validator.lgbValidator)) $validator.lgbValidator().reset();
});
}
function handler(cid, event) {
var source = $("#" + cId);
source.data('click', name);

View File

@ -100,6 +100,11 @@
e.stopImmediatePropagation();
}
});
if (this.options.modal) {
$(this.options.modal).on('show.bs.modal', function (e) {
that.reset();
});
}
};
Validate.VERSION = '2.0';
@ -112,11 +117,11 @@
};
Validate.prototype.defaults = function () {
return $.extend({ container: this.$element }, Validate.DEFAULTS, {
return $.extend(Validate.DEFAULTS, {
validClass: this.$element.attr('data-validclass'),
errorClass: this.$element.attr('data-errorclass'),
validButtons: this.$element.attr('data-valid-button'),
container: this.$element.attr('data-container')
modal: this.$element.attr('data-valid-modal')
});
};