ArcBees / gwtquery

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

How to bind Touch Events with GWTQuery? #318

Open confile opened 9 years ago

confile commented 9 years ago

To bind events like click with GQuery you can do something like:

@UiField
Element myButton;

... 

$(myButton).on("click", new Function() {
  @Override
  public void f() {
    // event is triggered
  }
}

What I need is support for touch events like Tap as it was implemented in MGWT. In MGWT you can use a TouchPanel to get a tap event like this:

@UiField
TouchPanel panel;

...

panel.addTapHandler(...);

Is there a way to bind a tap event with GQuery as it is done for the TouchPanel?

christiangoudreau commented 9 years ago

I'm not sure if it will work but, GQuery uses browser native events. Tap event is "tap" and you should be able to bind on it.

confile commented 9 years ago

@christiangoudreau is "tap" without the 300ms delay?

christiangoudreau commented 9 years ago

Okay, it seems like if "tap" isn't a native event. +1 for GQuery-Mobile then! :D

confile commented 9 years ago

@christiangoudreau Could you please post a link of GQuery-Mobile? Or is it still a dream? :-)

christiangoudreau commented 9 years ago

Not a dream, but a requested feature that we should definitely work on!

confile commented 9 years ago

That would be great. Is there some workaround for the moment?

christiangoudreau commented 9 years ago

You could probably look at gesture events instead: http://www.html5rocks.com/en/mobile/touch/#toc-events

Touch events is probably what you're looking for (touch start, touch ends and starting a timer on touch start of 300ms, stoping it if you reach 300ms or on touch end)

manolo commented 9 years ago

Im working on a gestures plugin for gquery I'll post about it when release it

On Sat, Dec 13, 2014, 9:21 PM christiangoudreau notifications@github.com wrote:

You could probably look at gesture events instead: http://www.html5rocks.com/en/mobile/touch/#toc-events

Touch events is probably what you're looking for (touch start, touch ends and starting a timer on touch start of 300ms, stoping it if you reach 300ms or on touch end)

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/gwtquery/issues/318#issuecomment-66889826.

confile commented 9 years ago

@manolo When will you release it?

manolo commented 9 years ago

Before gwt.create On Dec 13, 2014 11:16 PM, "Confile" notifications@github.com wrote:

@manolo https://github.com/manolo When will you release it?

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/gwtquery/issues/318#issuecomment-66893709.

confile commented 9 years ago

So before Jan 2015 which means this month.