<when-property-is name="user.agent" value="ie6" />
</replace-with>
+ <!-- Event dispatcher -->
+ <replace-with class="com.google.gwt.query.client.plugins.Events.EventDispatcherTrident">
+ <when-type-is class="com.google.gwt.query.client.plugins.Events.EventDispatcher" />
+ <any>
+ <when-property-is name="user.agent" value="ie6" />
+ <when-property-is name="user.agent" value="ie8" />
+ </any>
+ </replace-with>
+
<!-- IE8 needs the iframe where the js of app is loaded set to standard in order
to use the queryAll native selector -->
<define-linker name="stddoctype" class="com.google.gwt.query.linker.IFrameWithDocTypeLinker"/>
*/
package com.google.gwt.query.client.plugins;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.FormElement;
import com.google.gwt.dom.client.NativeEvent;
}
});
+ private static final EventDispatcher EVENT_DISPATCHER = GWT.create(EventDispatcher.class);
+
/**
* Don't apply events on text and comment nodes !!
*/
for (Element e : elements()) {
if (isEventCapable(e)) {
$(e).data(EventsListener.EVENT_DATA, datas);
- e.dispatchEvent(evt);
+
+ EVENT_DISPATCHER.dispatch(e, evt);
+
if (!JsUtils.isDefaultPrevented(evt)) {
callHandlers(e, evt, funcs);
}
}
}
+ static class EventDispatcher {
+ public void dispatch(Element e, NativeEvent evt) {
+ e.dispatchEvent(evt);
+ }
+ }
+
+ @SuppressWarnings("unused")
+ static class EventDispatcherTrident extends EventDispatcher {
+ public void dispatch(Element e, NativeEvent evt) {
+ // bitless event ?
+ if (Event.getTypeInt(evt.getType()) != -1) {
+ super.dispatch(e, evt);
+ } else {
+ EventsListener.getInstance(e).dispatchEvent(evt.<Event>cast());
+ }
+ }
+ }
+
}