senchalabs/jQTouch — pull request #421 by daraosn (2012-05-16 08:04:03+00:00)
Title: fallback for non-3d browsers bug fix

When using a non-3d browser, if you call same effect twice it will cause 'undefined in current' class error and jQTouch stops working.

This is because on ´´´.goTo()´´´ function you pass ´´´animation = animations[i]´´´ as reference of the animation array.

The problem is that on ´´´.doNavigation()´´´ you replace the animation.name with default animation, in order to fallback, but this replaces the name of the original array, causing jQTouch to stop working (because ´´´animation.name´´´ is undefined since ´´´animation´´´ is a string).

To fix this I just reverted the order in which you define ´´´finalAnimationName´´´ variable and then I check if the browser supports 3d, but this time changing this local variable instead of animation.name.

Here, using Chrome over Ubuntu (without WebGL due to VMWare 3d software rendering).