code-dot-org/blockly — pull request #665 by cpirich (2014-06-12 16:16:03+00:00)
Title: [#70374808] only preventDefault when running - allows touch scrolling before running

When initializing hammer with the preventDefault: true option, it will prevent the browser from seeing the touch gestures and doing things like scrolling the page.

This is good while we're running (you definitely don't want the swipes to both move objects in the playspace and scroll the page), but bad while we're not running (because it makes the page really hard to vertically scroll on touch devices while you're editing blocks).

Now I call e.gesture.preventDefault() at runtime if the 'drag' event comes in to studio or bounce while we're running.

I think this technique should be applied for flappy as well, but it handles the click event differently. Also, I think we should leverage something like this for Blockly core (so the page can still be scrolled), but that's a harder project for later.