]> source.dussan.org Git - gwtquery.git/commitdiff
make rebind static and call sink only if a gwt EventListener is associated to the...
authorJulien Dramaix <julien.dramaix@gmail.com>
Tue, 29 Mar 2011 01:02:03 +0000 (01:02 +0000)
committerJulien Dramaix <julien.dramaix@gmail.com>
Tue, 29 Mar 2011 01:02:03 +0000 (01:02 +0000)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java

index 3903794d6b2e9e38a4e019e4cab1cfde7384749e..dbb7e70a0e944a2b0c098379a8d9f3ca9ac635a9 100644 (file)
@@ -79,12 +79,19 @@ public class EventsListener implements EventListener {
       ret.clean();
     } 
   }
-
+  
   public static EventsListener getInstance(Element e) {
     EventsListener ret = getGQueryEventListener(e);
     return ret != null ? ret : new EventsListener(e);
   }
 
+  public static void rebind(Element e) {
+    EventsListener ret = getGQueryEventListener(e);
+    if (ret != null && ret.eventBits != 0){
+      ret.sink();
+    } 
+  }
+
   private static native void cleanGQListeners(Element elem) /*-{
                if (elem.__gwtlistener) {
                        elem.__listener = elem.__gwtlistener;
@@ -221,10 +228,6 @@ public class EventsListener implements EventListener {
     dispatchEvent(event);
   }
   
-  public void rebind() {
-    sink();
-  }
-  
   public void unbind(int eventbits) {
     unbind(eventbits, null);
   }