Shopify/turbograft — pull request #39 by pickle27 (2014-11-26 20:00:49+00:00)
Title: fix pageChangePrevented method

while working on some new features for form.coffee in Shopify I discovered that the page:before-change event and the `pageChangePrevented` code is not consistent or working properly. `pageChangePrevented` was defined in `turbolinks.coffee` but never used and redefined in `click.coffee` with an underscore prepended. The code was actually used in the `click.coffee` code to fire the event and stop the request if the event returned false. This seems to stem from our refactor of turbolinks into separate files.

Changes
=======
* check pageChangePrevented in turbolinks#fetch
* now that pageChangePrevented is checked in fetch remove dead code from click.coffee
* add a proper test for pageChangePrevented
* send the turbolink url in the event.data (tested)

I checked the original turbolinks module and they have the same issue I noticed here - `pageChangePrevented` is only fired from the `click` code rather than checking inside of fetch. I can't see any reason this is - the only other thing that calls fetch is from the history handler and it is working fine for me.

for review
@nsimmons @pushrax @qq99

I also bumped the version to 0.0.9 so we can ship this separate from the other things in the queue