From 9a9f2b09872fcd4c424bc3bf885b09b7a506a288 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Sun, 15 Dec 2013 19:43:57 -0800 Subject: [PATCH] Implement index() without arguments. Fixes issue #225 --- .../src/main/java/com/google/gwt/query/client/GQuery.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 d2a89d6f..cd75ccd3 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 @@ -2545,6 +2545,13 @@ public class GQuery implements Lazy { } return -1; } + + /** + * Return the position of the first matched element in relation with its sibblings. + */ + public int index() { + return prevAll().size(); + } /** * Returns the inner height of the first matched element, including padding but not the vertical -- 2.39.5