diff options
author | Julien Dramaix <julien.dramaix@gmail.com> | 2011-03-03 21:31:51 +0000 |
---|---|---|
committer | Julien Dramaix <julien.dramaix@gmail.com> | 2011-03-03 21:31:51 +0000 |
commit | 477fb6941d2b99634bbd532e4bf087c13393cccd (patch) | |
tree | e82c96d828d62faffbb8b8f6ef12e086ce465094 | |
parent | f90023494df1689933e1459d3e1c143b533b2987 (diff) | |
download | gwtquery-477fb6941d2b99634bbd532e4bf087c13393cccd.tar.gz gwtquery-477fb6941d2b99634bbd532e4bf087c13393cccd.zip |
bug in replaceAll() method
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java | 14 | ||||
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java | 39 |
2 files changed, 41 insertions, 12 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index ae382c92..ee082eae 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -1984,7 +1984,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> { }
/**
- * Replaces the elements matched by the specified selector with the matched
+ * Replaces the element <code>elem</code> by the specified selector with the matched
* elements. This function is the complement to replaceWith() which does the
* same task with the parameters reversed.
*/
@@ -1993,13 +1993,13 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> { }
/**
- * Replaces the elements matched by the specified selector with the matched
+ * Replaces the elements matched by the target with the matched
* elements. This function is the complement to replaceWith() which does the
* same task with the parameters reversed.
*/
- public GQuery replaceAll(GQuery query) {
- for (Element e : elements()) {
- $(e).replaceWith(query);
+ public GQuery replaceAll(GQuery target) {
+ for (Element e : target.elements()) {
+ $(e).replaceWith(this);
}
return this;
}
@@ -2009,8 +2009,8 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> { * elements. This function is the complement to replaceWith() which does the
* same task with the parameters reversed.
*/
- public GQuery replaceAll(String html) {
- return replaceAll($(html));
+ public GQuery replaceAll(String selector) {
+ return replaceAll($(selector));
}
/**
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index 23c43914..d3a49767 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -14,18 +14,47 @@ * the License. */ package com.google.gwt.query.client; +import static com.google.gwt.query.client.plugins.Effects.Effects; +import static com.google.gwt.query.client.plugins.Events.Events; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; - +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayString; +import com.google.gwt.dom.client.BodyElement; +import com.google.gwt.dom.client.ButtonElement; +import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.IFrameElement; +import com.google.gwt.dom.client.InputElement; import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.NodeList; +import com.google.gwt.dom.client.OptionElement; +import com.google.gwt.dom.client.SelectElement; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.HasCssName; +import com.google.gwt.dom.client.TextAreaElement; import com.google.gwt.query.client.css.CSS; import com.google.gwt.query.client.css.HasCssValue; import com.google.gwt.query.client.css.TakesCssValue; import com.google.gwt.query.client.css.TakesCssValue.CssSetter; +import com.google.gwt.query.client.impl.DocumentStyleImpl; +import com.google.gwt.query.client.impl.SelectorEngine; +import com.google.gwt.query.client.js.JsCache; +import com.google.gwt.query.client.js.JsMap; import com.google.gwt.query.client.js.JsNodeArray; +import com.google.gwt.query.client.js.JsUtils; +import com.google.gwt.query.client.plugins.Plugin; +import com.google.gwt.query.client.plugins.events.EventsListener; +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.EventListener; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Widget; +import com.google.gwt.query.client.LazyBase; public interface LazyGQuery<T> extends LazyBase<T>{ @@ -926,25 +955,25 @@ public interface LazyGQuery<T> extends LazyBase<T>{ LazyGQuery<T> removeData(String name); /** - * Replaces the elements matched by the specified selector with the matched + * Replaces the element <code>elem</code> by the specified selector with the matched * elements. This function is the complement to replaceWith() which does the * same task with the parameters reversed. */ LazyGQuery<T> replaceAll(Element elem); /** - * Replaces the elements matched by the specified selector with the matched + * Replaces the elements matched by the target with the matched * elements. This function is the complement to replaceWith() which does the * same task with the parameters reversed. */ - LazyGQuery<T> replaceAll(GQuery query); + LazyGQuery<T> replaceAll(GQuery target); /** * Replaces the elements matched by the specified selector with the matched * elements. This function is the complement to replaceWith() which does the * same task with the parameters reversed. */ - LazyGQuery<T> replaceAll(String html); + LazyGQuery<T> replaceAll(String selector); /** * Replaces all matched elements with the specified HTML or DOM elements. This |