]> source.dussan.org Git - gwtquery.git/commitdiff
Fixing an old bug in code which was making live methods without context fail the...
authorManolo Carrasco <manolo@apache.org>
Sat, 9 Apr 2011 14:45:46 +0000 (14:45 +0000)
committerManolo Carrasco <manolo@apache.org>
Sat, 9 Apr 2011 14:45:46 +0000 (14:45 +0000)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java

index bc7c807fbde8c77b3baf38899fd6052b55b08bf4..501d2cb5b5bba9357a3355aa91bd708c17e7169c 100644 (file)
@@ -342,9 +342,10 @@ public class EventsListener implements EventListener {
       }
     } else {
       LiveBindFunction liveBindFunction = liveBindFunctionByEventType.get(eventbits);
-      liveBindFunction.removeBindFunctionForSelector(cssSelector);
+      if (liveBindFunction != null) {
+        liveBindFunction.removeBindFunctionForSelector(cssSelector);
+      }
     }
-
   }
 
   public void dispatchEvent(Event event) {
@@ -395,13 +396,14 @@ public class EventsListener implements EventListener {
   }
 
   public void onBrowserEvent(Event event) {
+    double now = Duration.currentTimeMillis();
     // Workaround for Issue_20
     if (lastType == event.getTypeInt()
-        && lastEvnt - Duration.currentTimeMillis() < 10
+        && now - lastEvnt < 10
         && "body".equalsIgnoreCase(element.getTagName())) {
       return;
     }
-    lastEvnt = Duration.currentTimeMillis();
+    lastEvnt = now;
     lastType = event.getTypeInt();
 
     // Execute the original Gwt listener