<artifactId>gwtquery</artifactId>
<packaging>jar</packaging>
- <version>1.4.1</version>
+ <version>1.4.2-SNAPSHOT</version>
<name>Gwt Query Core API</name>
<url>http://gquery.org</url>
<dependencies>
import com.google.gwt.dom.client.FormElement;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Node;
-import com.google.gwt.event.dom.client.HasNativeEvent;
import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.js.JsUtils;
// Ie6-8 don't dispatch bitless event
if ((browser.ie6 || browser.ie8) && Event.getTypeInt(evt.getType()) == -1) {
- EventsListener.getInstance(e).dispatchEvent(evt.<Event>cast());
+ bubbleEventForIE(e, evt.<Event>cast());
} else {
e.dispatchEvent(evt);
}
}
}
+ private void bubbleEventForIE(Element e, Event event) {
+ if (e == null || "html".equalsIgnoreCase(e.getTagName()) || isEventPropagationStopped(event)) {
+ return;
+ }
+
+ EventsListener.getInstance(e).dispatchEvent(event);
+
+ bubbleEventForIE(e.getParentElement(), event);
+ }
+
+ /**
+ * Only valid for IE6-8
+ * @param event
+ * @return
+ */
+ private native boolean isEventPropagationStopped(Event event)/*-{
+ return !!event.cancelBubble;
+ }-*/;
+
private void callHandlers(Element e, NativeEvent evt, Function... functions){
for (Function f : functions) {
f.setEvent(Event.as(evt));
<groupId>com.googlecode.gwtquery</groupId>
<artifactId>gwtquery-project</artifactId>
<packaging>pom</packaging>
- <version>1.4.1</version>
+ <version>1.4.2-SNAPSHOT</version>
<name>Gwt Query Project</name>
<url>http://gwtquery.com</url>
<description>GwtQuery is a jQuery clone written in GWT.</description>