From: Manolo Carrasco Date: Mon, 29 Aug 2011 10:22:56 +0000 (+0000) Subject: resize method in GQuery was doing nothing. isEventCapable did not consider window... X-Git-Tag: release-1.3.2~226 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=edcf57a2e60410e6e3ff4226dfafee5632326040;p=gwtquery.git resize method in GQuery was doing nothing. isEventCapable did not consider window object (fixes issue102), thanks for the patch to arny.ok --- 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 a51ef266..0df60ea7 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 @@ -3249,8 +3249,8 @@ public class GQuery implements Lazy { /** * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. */ - public void resize(final Function f) { - + public GQuery resize(final Function f) { + return bindOrFire(EventsListener.ONRESIZE, null, f); } /** diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java index 33b48b3b..e60c76ef 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java @@ -42,7 +42,7 @@ public class Events extends GQuery { * Don't apply events on text and comment nodes !! */ private static boolean isEventCapable(Node n){ - return n.getNodeType() != 3 && n.getNodeType() != 8; + return n.equals(GQuery.window) || n.getNodeType() != 3 && n.getNodeType() != 8; } public Events(GQuery gq) {