PDA

View Full Version : How to prevent tap events during animations?



dreamdu5t
27 Jun 2011, 2:56 PM
How would I prevent tap events during a card transition?

Sometimes users can tap a list item as it's being transitioned and it screws everything up.

mkilroy
21 Jul 2011, 9:02 AM
I have the same problem. Did you find a solution?

Hertz
21 Jul 2011, 9:19 AM
One way is to mask your application while it's making the transition.

http://dev.sencha.com/deploy/touch/docs/?class=Ext.Panel
setLoading( Boolean/Object load, Boolean targetEl );

You could also set a flag variable and check its value inside the tap listener.

-Initialize the variable as false.
-When the container panel fires the 'beforecardswitch' event you set
prevent_tap = true;
-When it fires 'cardswitch' you set it back to false
prevent_tap = false;

And you check for this flag on the tap listener of your list.

There are many ways.