You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2015/05/30 14:53:59 UTC

[2/3] wicket git commit: WICKET-5901 Leaving veil when ajax processing ends with redirect

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/bfad47ee
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/bfad47ee
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/bfad47ee

Branch: refs/heads/master
Commit: bfad47ee743c27b0f16dd520b3a80369434a1409
Parents: 8f68e0f
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri May 22 23:53:31 2015 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Sat May 30 15:53:30 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/bfad47ee/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;
 		},