]> source.dussan.org Git - gwtquery.git/commitdiff
Implement index() without arguments. Fixes issue #225
authorManolo Carrasco <manolo@apache.org>
Mon, 16 Dec 2013 03:43:57 +0000 (19:43 -0800)
committerManolo Carrasco <manolo@apache.org>
Mon, 16 Dec 2013 03:43:57 +0000 (19:43 -0800)
gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java

index d2a89d6fdb86ba597143165a265b295908296949..cd75ccd36cf5a2b28bf36a5fa58cfd61d028c6ce 100644 (file)
@@ -2545,6 +2545,13 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
     }
     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