WICKET-5901 Leaving veil when ajax processing ends with redirect

Do not hide the Ajax indicator if there is a redirect to another page

(cherry picked from commit ad89910da115454f0f54cc33f9a14a6fc4a41e52)


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/eea5c7af
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/eea5c7af
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/eea5c7af

Branch: refs/heads/WICKET-5906-7.x
Commit: eea5c7aff8ef0f72daeb95b1ad38804c969e746f
Parents: 8fa1988
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Fri May 22 23:53:31 2015 +0300
Committer: Andrea Del Bene <“[email protected]”>
Committed: Wed Jun 3 10:04:20 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/eea5c7af/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 0261de3..88d3983 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -695,7 +695,7 @@
                                complete: function (jqXHR, textStatus) {
 
                                        
context.steps.push(jQuery.proxy(function (notify) {
-                                               if (attrs.i) {
+                                               if (attrs.i && 
context.isRedirecting !== true) {
                                                        
Wicket.DOM.hideIncrementally(attrs.i);
                                                }
 
@@ -766,6 +766,7 @@
 
                                        // support/check for non-relative 
redirectUrl like as provided and needed in a portlet context
                                        if (redirectUrl.charAt(0) === '/' || 
rhttp.test(redirectUrl) || rhttps.test(redirectUrl)) {
+                                               context.isRedirecting = true;
                                                window.location = redirectUrl;
                                        }
                                        else {
@@ -790,6 +791,7 @@
                                                        calculatedRedirect = 
window.location.protocol + "//" + window.location.host + calculatedRedirect;
                                                }
 
+                                               context.isRedirecting = true;
                                                window.location = 
calculatedRedirect;
                                        }
                                }
@@ -920,7 +922,7 @@
                                }, 0);
 
                                var attrs = context.attrs;
-                               if (attrs.i) {
+                               if (attrs.i && context.isRedirecting !== true) {
                                        // hide the indicator
                                        Wicket.DOM.hideIncrementally(attrs.i);
                                }
@@ -1238,6 +1240,7 @@
                processRedirect: function (context, node) {
                        var text = Wicket.DOM.text(node);
                        Wicket.Log.info("Redirecting to: " + text);
+                       context.isRedirecting = true;
                        window.location = text;
                },
 

Reply via email to