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/22 17:53:03 UTC

[1/6] git commit: WICKET-4236 Use JQuery as a backing library for Wicket's JavaScript code

Updated Branches:
  refs/heads/master 9c42e1338 -> e42f2887c


WICKET-4236 Use JQuery as a backing library for Wicket's JavaScript code

Replace #replaceWith() with $after().remove() - according to http://jsperf.com/jquery-replacewith-vs-after-plus-remove the new approach is a bit faster in some browsers.


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

Branch: refs/heads/master
Commit: e42f2887cfbcfc052cd4bf0527cbec739adcbaf2
Parents: 7da82df
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Wed Feb 22 17:26:16 2012 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Wed Feb 22 17:26:16 2012 +0100

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


http://git-wip-us.apache.org/repos/asf/wicket/blob/e42f2887/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 8fdbeeb..18f8736 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
@@ -1384,7 +1384,8 @@
 					return;
 				} else {
 					var $newElement = jQuery(text);
-					jQuery(element).replaceWith($newElement);
+					// WICKET-4236
+					jQuery(element).after($newElement).remove();
 				}
 
 				var newElement = Wicket.$(element.id);