]> source.dussan.org Git - gwtquery.git/commitdiff
Ability to create new events with different type
authorManolo Carrasco <manolo@apache.org>
Thu, 29 Jan 2015 10:16:45 +0000 (11:16 +0100)
committerManolo Carrasco <manolo@apache.org>
Thu, 29 Jan 2015 10:26:16 +0000 (11:26 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/GqEvent.java

index 8493fd81e717d2f7d2301e82a9b75a3dc49a3524..59757bb632b1862bbf7c3e3eacca2233d0fa1942 100644 (file)
@@ -17,6 +17,7 @@ package com.google.gwt.query.client.plugins.events;
 
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.query.client.GQuery;
+import com.google.gwt.query.client.js.JsUtils;
 import com.google.gwt.user.client.Event;
 
 /**
@@ -110,4 +111,10 @@ public class GqEvent extends Event {
   public static final GqEvent as(Event e) {
     return e.cast();
   }
+
+  public static Event create(Event event, String eventName) {
+    event = create(event);
+    JsUtils.prop(event, "type", eventName);
+    return event;
+  }
 }