aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java1
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java14
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java8
4 files changed, 25 insertions, 2 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 479f90ab..75d0c18b 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
@@ -2483,9 +2483,11 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* 'in' to a frequent task. Whenever the mouse cursor is moved over a matched element, the first
* specified function is fired. Whenever the mouse moves off of the element, the second specified
* function fires.
+ *
+ * Since GQuery 1.4.0, this method binds handlers for both mouseenter and mouseleave events.
*/
public GQuery hover(Function fover, Function fout) {
- return bind(Event.ONMOUSEOVER, null, fover).bind(Event.ONMOUSEOUT, null, fout);
+ return bind("mouseenter", null, fover).bind("mouseleave", null, fout);
}
/**
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java
index b8e73ae1..dad7099a 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java
@@ -811,5 +811,4 @@ public class EventsListener implements EventListener {
function.clean();
}
}
-
}
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java
index c86b67e4..50f99d6f 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java
@@ -2049,4 +2049,18 @@ public class GQueryCoreTestGwt extends GWTTestCase {
assertEquals(ulParentsNumber + 2, result.size());
}
+ // issue #216 : https://github.com/gwtquery/gwtquery/issues/216
+ public void testDataAsInteger() {
+ $(e).html("<div id='target'></div>");
+
+ GQuery target = $("#target", e);
+
+ $("#target", e).data("intValue", new Integer(1));
+
+ Integer value = $("#target", e).data("intValue", Integer.class);
+
+ assertEquals(1, value.intValue());
+
+ }
+
}
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java
index 6795a35d..e3ada526 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java
@@ -1595,4 +1595,12 @@ public class GQueryEventsTestGwt extends GWTTestCase {
assertEquals(1, handler.invokationCounter);
}
+
+ public void testIssue226() {
+ $(e).html("<div id='target'>");
+ GQuery target = $("#target", e);
+
+ // this should not throw a NPE
+ target.undelegate("li", "click");
+ }
}