From ab19561d8a428088b1136cbbb1a26c5d5be0b467 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Fri, 19 Oct 2012 09:15:03 +0200 Subject: [PATCH] re-use gwt dom methods to check whether a node is attached to the dom --- .../main/java/com/google/gwt/query/client/js/JsUtils.java | 8 +++----- 1 file 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 -- 2.39.5