aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core/src/main
diff options
context:
space:
mode:
authorjdramaix <julien.dramaix@gmail.com>2014-12-17 11:17:28 +0100
committerjdramaix <julien.dramaix@gmail.com>2014-12-17 11:17:28 +0100
commit69ab01e7d6bba1d8bfd0783b33ad231650ecf5d8 (patch)
tree5538a7700861c378a4339d4596b8dcca2b124630 /gwtquery-core/src/main
parentac85d28be7ca341fa513bccd54960dcc1204327d (diff)
downloadgwtquery-jd_off.tar.gz
gwtquery-jd_off.zip
improve off and on methodsjd_off
Diffstat (limited to 'gwtquery-core/src/main')
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java13
1 files changed, 12 insertions, 1 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 09e69fe3..7f5bbf82 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
@@ -3236,6 +3236,10 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* Attach an event handler function for one or more events to the selected elements.
*/
public GQuery on(String eventName, String selector, Function... funcs) {
+ if (selector == null || selector.isEmpty()) {
+ return on(eventName, funcs);
+ }
+
return delegate(selector, eventName, funcs);
}
@@ -3243,6 +3247,10 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* Attach an event handler function for one or more events to the selected elements.
*/
public GQuery on(String eventName, String selector, Object data, Function... funcs) {
+ if (selector == null || selector.isEmpty()) {
+ return on(eventName, data, funcs);
+ }
+
return delegate(selector, eventName, data, funcs);
}
@@ -3250,7 +3258,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* Remove all event handlers.
*/
public GQuery off() {
- return as(Effects).off();
+ return as(Events).off();
}
/**
@@ -3271,6 +3279,9 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* Remove an event handler
*/
public GQuery off(String eventName, String selector) {
+ if (selector == null || selector.isEmpty()) {
+ return off(eventName);
+ }
return undelegate(selector, eventName);
}