From edcf57a2e60410e6e3ff4226dfafee5632326040 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Mon, 29 Aug 2011 10:22:56 +0000 Subject: [PATCH] resize method in GQuery was doing nothing. isEventCapable did not consider window object (fixes issue102), thanks for the patch to arny.ok --- .../src/main/java/com/google/gwt/query/client/GQuery.java | 4 ++-- .../main/java/com/google/gwt/query/client/plugins/Events.java | 2 +- 2 files changed, 3 insertions(+), 3 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 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) { -- 2.39.5