java - Click event being fired even not clicking -
i have code fires if don't click on on page, hovering on page trigger:
event.addnativepreviewhandler(new event.nativepreviewhandler() { @override public void onpreviewnativeevent(event.nativepreviewevent event) { switch (event.gettypeint()) { case event.onclick: $(".hopscotch-bubble").fadeout(new com.google.gwt.query.client.function() { @override public void f() { jsnihelper.infonotify("info", "fade out method invoked!"); } }); } } });
i not entirely sure why happens, reason?
add clickhandler on root panel called when native click event fired anywhere on page.
sample code:
import com.google.gwt.event.dom.client.clickevent; import com.google.gwt.event.dom.client.clickhandler; import com.google.gwt.user.client.ui.rootpanel; rootpanel.get().adddomhandler(new clickhandler() { @override public void onclick(clickevent event) { system.out.println("click"); } }, clickevent.gettype());
Comments
Post a Comment