Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page:before-unload event not present #111

Open
lgo opened this issue Feb 23, 2016 · 3 comments
Open

page:before-unload event not present #111

lgo opened this issue Feb 23, 2016 · 3 comments

Comments

@lgo
Copy link

lgo commented Feb 23, 2016

There were a number of events that Turbolinks fires but seem to have been pulled out of Turbograft (or these were added later into Turbolinks), one being page:before-unload. Are there any plans to add it, or alternatives?

@qq99
Copy link
Contributor

qq99 commented Feb 23, 2016

Which ones are missing?

@pushrax
Copy link
Contributor

pushrax commented Feb 23, 2016

We can probably just add any events you need.

@lgo
Copy link
Author

lgo commented Feb 23, 2016

It's no immediate problem since I've moved the project to turbolinks 5 without a problem.

The one event binding that was needed was page:before-node-removed which I think could be above page:after-node-removed at

replaceNode = (newNode, oldNode) ->
replacedNode = oldNode.parentNode.replaceChild(newNode, oldNode)
triggerEvent('page:after-node-removed', replacedNode)
removeNode = (node) ->
removedNode = node.parentNode.removeChild(node)
triggerEvent('page:after-node-removed', removedNode)

You can close this if you don't think it's necessary to add any events, at first I think I had expectations of turbolinks 4 events (currently turbolinks-classic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants