aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core
diff options
context:
space:
mode:
authorJulien Dramaix <julien.dramaix@gmail.com>2012-08-17 12:52:23 +0000
committerJulien Dramaix <julien.dramaix@gmail.com>2012-08-17 12:52:23 +0000
commita0ff70a5841a70c1eaa73b7564f02dc51a5064df (patch)
tree0edf3dc8fd814658f6c2d384e5afe625067aeae8 /gwtquery-core
parentc3faf08ceb0572a362413e2028262e0f5ca81091 (diff)
downloadgwtquery-a0ff70a5841a70c1eaa73b7564f02dc51a5064df.tar.gz
gwtquery-a0ff70a5841a70c1eaa73b7564f02dc51a5064df.zip
bug in nextAll(String filter) method
Diffstat (limited to 'gwtquery-core')
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java26
1 files changed, 19 insertions, 7 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 63bfe9f6..134e84cb 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
@@ -17,11 +17,6 @@ package com.google.gwt.query.client;
import static com.google.gwt.query.client.plugins.QueuePlugin.Queue;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
@@ -68,6 +63,11 @@ import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.GqUi;
import com.google.gwt.user.client.ui.Widget;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
/**
* GwtQuery is a GWT clone of the popular jQuery library.
*/
@@ -2133,11 +2133,21 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
/**
* Removes all elements from the set of matched elements that do not pass the
* specified css expression. This method is used to narrow down the results of
- * a search. Provide a comma-separated list of expressions to apply multiple
- * filters at once.
+ * a search.
*/
+ //TODO performance bad...
public GQuery filter(String... filters) {
JsNodeArray array = JsNodeArray.create();
+ /*StringBuilder filterBuilder = new StringBuilder();
+ for (int i = 0; i < filters.length ; i++){
+ filterBuilder.append(filters[i]);
+ if (i < filters.length - 1){
+ filterBuilder.append(",");
+ }
+ }
+
+ String filter = filterBuilder.toString();*/
+
for (String f : filters) {
for (Element e : elements) {
boolean ghostParent = false;
@@ -2159,6 +2169,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
}
}
}
+
return pushStack(unique(array), "filter", filters[0]);
}
@@ -2870,6 +2881,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
for (Element e : elements) {
allNextSiblingElements(e.getNextSiblingElement(), result, null, null, filter);
}
+
return pushStack(unique(result), "nextAll", getSelector());
}