init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
50
Public/user/js/post.loading.js
可执行文件
50
Public/user/js/post.loading.js
可执行文件
@@ -0,0 +1,50 @@
|
||||
//提交时给ajaxForm方法加上loading动画,防止提交按钮重复点击,用法:$('form').loadingForm()
|
||||
(function ($) {
|
||||
$.fn.loadingForm = function (options) {
|
||||
console.log(11111)
|
||||
this.each(function () {
|
||||
var el = this;
|
||||
$(el).ajaxForm({
|
||||
beforeSubmit: function (data) {
|
||||
if (options.beforeSubmit != null) {
|
||||
if (options.beforeSubmit(data)) {
|
||||
layer.load();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
layer.load();
|
||||
return true;
|
||||
},
|
||||
success: function (data) {
|
||||
layer.closeAll();
|
||||
if (options.success != null) {
|
||||
options.success(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
//给post方法加上loading动画,防止提交按钮重复点击,用法:$.loadingPost()
|
||||
(function ($) {
|
||||
$.loadingPost = function (url, data, callback) {
|
||||
console.log(11111)
|
||||
layer.load();
|
||||
if ($.isFunction(data)) {
|
||||
$.post(url, function (d) {
|
||||
layer.closeAll();
|
||||
if (data) {
|
||||
data(d);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.post(url, data, function (d) {
|
||||
layer.closeAll();
|
||||
if (callback) {
|
||||
callback(d);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
在新工单中引用
屏蔽一个用户