turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

How can i get event.data? #586

Closed vizo closed 9 years ago

vizo commented 9 years ago

I can't figure out how can i get event.data in page:before-change event ... it's always undefined... (i use master) ...

vizo commented 9 years ago

I figured it out. If you are using jQuery, you must look at event.originalEvent.data.

But i still get just url property :(

Attach affected elements to the page:before-unload, page:change, page:load and page:partial-load events (in event.data).

I want to trigger confirm dialog on page:before-change (to cancel event or not), but i need also to know affected elements (if parent element of form will be changed, if not, i don't need to ask user). I think this is very common case.

Is there a reason why page:before-change event.data holds just url and not also affected elements?