From f3effb9bce34038dbf904c39d691b9ca3f2784ee Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Sun, 23 Jan 2011 21:27:35 +0000 Subject: [PATCH] adding innerWidth and innerHeight methods and deprecating contentWidth and contentHeight to have the same names that jQuery --- .../com/google/gwt/query/client/GQuery.java | 28 +++++++++++++++---- .../google/gwt/query/client/LazyGQuery.java | 18 +++++++++--- 2 files changed, 36 insertions(+), 10 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 ba00f65a..1576f622 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 @@ -859,19 +859,19 @@ public class GQuery implements Lazy { } /** - * Returns the inner height of the first matched element, including padding - * but not the vertical scrollbar height, border, or margin. + * @deprecated use innerHeight() */ + @Deprecated public int clientHeight() { - return get(0).getClientHeight(); + return innerHeight(); } /** - * Returns the inner width of the first matched element, including padding - * but not the vertical scrollbar width, border, or margin. + * @deprecated use innerWidth() */ + @Deprecated public int clientWidth() { - return get(0).getClientWidth(); + return innerWidth(); } /** @@ -1367,6 +1367,22 @@ public class GQuery implements Lazy { return -1; } + /** + * Returns the inner height of the first matched element, including padding + * but not the vertical scrollbar height, border, or margin. + */ + public int innerHeight() { + return get(0).getClientHeight(); + } + + /** + * Returns the inner width of the first matched element, including padding + * but not the vertical scrollbar width, border, or margin. + */ + public int innerWidth() { + return get(0).getClientWidth(); + } + /** * Insert all of the matched elements after another, specified, set of * elements. 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 baf0a680..53b19a47 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 @@ -251,14 +251,12 @@ public interface LazyGQuery extends LazyBase{ LazyGQuery click(Function...f); /** - * Returns the inner height of the first matched element, including padding - * but not the vertical scrollbar height, border, or margin. + * @deprecated use innerHeight() */ int clientHeight(); /** - * Returns the inner width of the first matched element, including padding - * but not the vertical scrollbar width, border, or margin. + * @deprecated use innerWidth() */ int clientWidth(); @@ -549,6 +547,18 @@ public interface LazyGQuery extends LazyBase{ */ int index(Element element); + /** + * Returns the inner height of the first matched element, including padding + * but not the vertical scrollbar height, border, or margin. + */ + int innerHeight(); + + /** + * Returns the inner width of the first matched element, including padding + * but not the vertical scrollbar width, border, or margin. + */ + int innerWidth(); + /** * Insert all of the matched elements after another, specified, set of * elements. -- 2.39.5