From: jdramaix Date: Fri, 29 Nov 2013 10:53:52 +0000 (+0100) Subject: Code review comment X-Git-Tag: release-1.4.0~27^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2c8e10ae8f56a8d01e09d294c41093e90cc55ec5;p=gwtquery.git Code review comment --- 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 @@ - - - - - - - - - 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.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.cast()); - } - } - } - }