From: Alexander Ebert Date: Thu, 14 Feb 2013 18:07:11 +0000 (+0100) Subject: Added option to show loading overlay for a single request X-Git-Tag: 2.0.0_Beta_1~482 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=906c8f230c3e1be1f8f5881ebc56017142827b7d;p=GitHub%2FWoltLab%2FWCF.git Added option to show loading overlay for a single request --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 98e6a63ce1..09651ef133 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1445,6 +1445,12 @@ WCF.Action = {}; * @param object options */ WCF.Action.Proxy = Class.extend({ + /** + * shows loading overlay for a single request + * @var boolean + */ + _showLoadingOverlayOnce: false, + /** * suppresses errors * @var boolean @@ -1472,6 +1478,7 @@ WCF.Action.Proxy = Class.extend({ this.confirmationDialog = null; this.loading = null; + this._showLoadingOverlayOnce = false; this._suppressErrors = false; // send request immediately after initialization @@ -1499,6 +1506,13 @@ WCF.Action.Proxy = Class.extend({ }); }, + /** + * Shows loading overlay for a single request. + */ + showLoadingOverlayOnce: function() { + this._showLoadingOverlayOnce = true; + }, + /** * Fires before request is send, displays global loading status. */ @@ -1507,7 +1521,7 @@ WCF.Action.Proxy = Class.extend({ this.options.init(this); } - if (this.options.showLoadingOverlay) { + if (this.options.showLoadingOverlay || this._showLoadingOverlayOnce) { WCF.LoadingOverlayHandler.show(); } }, @@ -1576,8 +1590,12 @@ WCF.Action.Proxy = Class.extend({ this.options.after(); } - if (this.options.showLoadingOverlay) { + if (this.options.showLoadingOverlay || this._showLoadingOverlayOnce) { WCF.LoadingOverlayHandler.hide(); + + if (this._showLoadingOverlayOnce) { + this._showLoadingOverlayOnce = false; + } } // disable DOMNodeInserted event