mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Added ability to hide ajax loading alert (#90)
This commit is contained in:
parent
d3f7d586d5
commit
770ca6d229
@ -314,10 +314,12 @@ Ajax.prototype = {
|
||||
request: {}, // request data
|
||||
params: {}, // action params, format: ajax.params[ElementID] = { param: "val" ... }
|
||||
form_token: '',
|
||||
hide_loading: null,
|
||||
|
||||
exec: function (request) {
|
||||
exec: function (request, hide_loading = false) {
|
||||
this.request[request.action] = request;
|
||||
request['form_token'] = this.form_token;
|
||||
this.hide_loading = hide_loading;
|
||||
$.ajax({
|
||||
url: this.url,
|
||||
type: this.type,
|
||||
@ -445,12 +447,16 @@ Ajax.prototype = {
|
||||
$(document).ready(function () {
|
||||
// Setup ajax-loading box
|
||||
$("#ajax-loading").ajaxStart(function () {
|
||||
if (ajax.hide_loading === false) {
|
||||
$("#ajax-error").hide();
|
||||
$(this).show();
|
||||
ajax.setStatusBoxPosition($(this));
|
||||
}
|
||||
});
|
||||
$("#ajax-loading").ajaxStop(function () {
|
||||
if (ajax.hide_loading === false) {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Setup ajax-error box
|
||||
|
Loading…
Reference in New Issue
Block a user