Repository: wicket
Updated Branches:
  refs/heads/WICKET-5901 [created] ad89910da


WICKET-5901 Leaving veil when ajax processing ends with redirect

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


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

Branch: refs/heads/WICKET-5901
Commit: ad89910da115454f0f54cc33f9a14a6fc4a41e52
Parents: eff2b25
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Fri May 22 23:53:31 2015 +0300
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Fri May 22 23:53:31 2015 +0300

----------------------------------------------------------------------
 .../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/ad89910d/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 a68d510..13163d5 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);
                                }
@@ -1242,6 +1244,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