diff options
author | jdramaix <julien.dramaix@gmail.com> | 2013-11-29 11:53:52 +0100 |
---|---|---|
committer | jdramaix <julien.dramaix@gmail.com> | 2013-11-29 11:53:52 +0100 |
commit | 2c8e10ae8f56a8d01e09d294c41093e90cc55ec5 (patch) | |
tree | 38432694e864a73782197acd41bbf59b0464c3aa /gwtquery-core | |
parent | c87250329232dcc4be705ad038d41e1309106838 (diff) | |
download | gwtquery-2c8e10ae8f56a8d01e09d294c41093e90cc55ec5.tar.gz gwtquery-2c8e10ae8f56a8d01e09d294c41093e90cc55ec5.zip |
Code review comment
Diffstat (limited to 'gwtquery-core')
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/Query.gwt.xml | 9 | ||||
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java | 29 |
2 files changed, 6 insertions, 32 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/Query.gwt.xml b/gwtquery-core/src/main/java/com/google/gwt/query/Query.gwt.xml index e12b298e..a902fd99 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/Query.gwt.xml +++ b/gwtquery-core/src/main/java/com/google/gwt/query/Query.gwt.xml @@ -144,15 +144,6 @@ <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"/> diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java index 897807f9..5d09fea8 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java @@ -13,7 +13,6 @@ */ 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; @@ -37,8 +36,6 @@ public class Events extends GQuery { } }); - private static final EventDispatcher EVENT_DISPATCHER = GWT.create(EventDispatcher.class); - /** * Don't apply events on text and comment nodes !! */ @@ -381,7 +378,12 @@ public class Events extends GQuery { if (isEventCapable(e)) { $(e).data(EventsListener.EVENT_DATA, datas); - EVENT_DISPATCHER.dispatch(e, evt); + // Ie6-8 don't dispatch bitless event + if ((browser.ie6 || browser.ie8) && Event.getTypeInt(evt.getType()) == -1) { + EventsListener.getInstance(e).dispatchEvent(evt.<Event>cast()); + } else { + e.dispatchEvent(evt); + } if (!JsUtils.isDefaultPrevented(evt)) { callHandlers(e, evt, funcs); @@ -397,23 +399,4 @@ public class Events extends GQuery { f.f(e); } } - - 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()); - } - } - } - } |