ArcBees / gwtquery

A jQuery clone for GWT, and much more.
MIT License
85 stars 38 forks source link

Event handling in bubbling phase #385

Open Schahen opened 7 years ago

Schahen commented 7 years ago

In /gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java there's a following piece of code:

  private static native void sinkBitlessEvent(Element elem, String name) /*-{
    if (!elem.__gquery)
      elem.__gquery = [];
    if (elem.__gquery[name])
      return;
    elem.__gquery[name] = true;

    var handle = function(event) {
      elem.__gqueryevent.@com.google.gwt.query.client.plugins.events.EventsListener::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(event);
    };

    if (elem.addEventListener)
      elem.addEventListener(name, handle, true);
    else
      elem.attachEvent("on" + name, handle);
  }-*/;

From what I see it seems to me that there's no possibility to add event handler for bubbling phase. If I'm wrong can someone show me how this is supposed to be done. If I'm right - what's the reasoning behind this? Would somebody mind if I'll create a PR for this if needed?