aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2012-10-19 09:15:03 +0200
committerManolo Carrasco <manolo@apache.org>2012-10-19 09:15:03 +0200
commitab19561d8a428088b1136cbbb1a26c5d5be0b467 (patch)
tree4ceb4ea672fd0b136a98e0d3b34d7a59fb74eee0 /gwtquery-core
parenta854153fedef67b47ecbf24d1d9d1f9c90a19c5e (diff)
downloadgwtquery-ab19561d8a428088b1136cbbb1a26c5d5be0b467.tar.gz
gwtquery-ab19561d8a428088b1136cbbb1a26c5d5be0b467.zip
re-use gwt dom methods to check whether a node is attached to the dom
Diffstat (limited to 'gwtquery-core')
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java
index 9d384a19..8a6c589b 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java
@@ -278,11 +278,9 @@ public class JsUtils {
/**
* Return whether a node is dettached to the dom
*/
- public static native boolean isDettached(Node n) /*-{
- while (n.parentNode)
- n = n.parentNode;
- return !n.body;
- }-*/;
+ public static boolean isDettached(Node n) {
+ return !getOwnerDocument(n).getBody().isOrHasChild(n);
+ }
/**
* Check is a javascript object can be cast to an Element