How can we implement this feature in Polymer?
(example from github wiki page editing)
I suppose we have an application based on the Polymer Starter Kit (so with page.js as router engine)
- my application uses a
product-editor
element which contains a textarea + a save button. - User is editing a product at the route
localhost/#!/product/127/edit
- He "accidentally" clicks on the Back button or other links on the page
I'd like to display the above confirmation dialog: "Are you sure to leave..."
How can we do this?
window.onbeforeunload
handler and use an element likepaper-dialog
. – miqh