更新脚本:移除未使用的event标记

This commit is contained in:
Argo-Surface 2018-11-22 15:55:54 +08:00
parent 79fb721f87
commit f8b69f01c8
1 changed files with 11 additions and 13 deletions

View File

@ -145,24 +145,22 @@
var loadingHandler = null;
if (options.loading && options.modal) {
var $modal = $(options.modal);
if (!$modal.hasClass('event')) {
$modal.on('shown.bs.modal', function () {
var $this = $(this);
if (loadingHandler !== null) {
window.clearTimeout(loadingHandler);
loadingHandler = null;
}
if ($this.hasClass(loadFlag)) return;
$this.modal('hide');
});
}
$modal.on('shown.bs.modal', function () {
var $this = $(this);
if (loadingHandler !== null) {
window.clearTimeout(loadingHandler);
loadingHandler = null;
}
if ($this.hasClass(loadFlag)) return;
$this.modal('hide');
});
loadingHandler = window.setTimeout(function () { $(options.modal).addClass(loadFlag).modal('show'); }, 300);
setTimeout(function () {
var loadTimeoutHandler = setTimeout(function () {
$(options.modal).find('.close').removeClass('d-none');
clearTimeout(loadTimeoutHandler);
}, options.loadingTimeout);
}
var data = options.method === 'get' ? options.data : JSON.stringify(options.data);
var url = options.id !== '' ? options.url + '/' + options.id : options.url;
if (options.query) {