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 2012/02/03 08:47:33 UTC

[4/6] git commit: Pass the parameters to the "already" functions as well. Wicket.Ajax.xyz() may be used from JS code and the developer may pass proper JS functions instead of function body (String) as we do in JSON attributes

Pass the parameters to the "already" functions as well.
Wicket.Ajax.xyz() may be used from JS code and the developer may pass proper JS functions instead of function body (String) as we do in JSON attributes


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

Branch: refs/heads/master
Commit: 4f857d1fc7c84a7fc2ff0276ef68d6c46b566efc
Parents: 112ae70
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Feb 2 16:47:06 2012 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Feb 3 09:30:49 2012 +0200

----------------------------------------------------------------------
 .../wicket/ajax/res/js/wicket-ajax-jquery.js       |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/4f857d1f/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 334d6ff..4953fa6 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
@@ -441,7 +441,7 @@
 					var dep = deps[i],
 						extraParam = {};
 					if (jQuery.isFunction(dep)) {
-						extraParam = dep();
+						extraParam = dep(attrs);
 					} else {
 						extraParam = new Function('attrs', dep)(attrs);
 					}
@@ -489,7 +489,7 @@
 							var precondition = preconditions[p];
 							var result;
 							if (jQuery.isFunction(precondition)) {
-								result = precondition();
+								result = precondition(attrs, jqXHR, settings);
 							} else {
 								result = new Function('attrs', 'jqXHR', 'settings', precondition)(attrs, jqXHR, settings);
 							}