Open jmuheim opened 9 years ago
This problem has been partially solved with the "do you want to save" dialog box, which appears when you click on a link in the editor application.
For the rest such as the case you are mentionning, there is onunload event, but at the time the event is sent, it don't allow such a dialog box to appear and there is no way to prevent from navigating away. I also tried to send an AJAX request to save the current document without asking anything to the user when this event is fired, but it isn't always desirable (what if I really want to go away without saving ?, and it doesn't reliably work anyway:
If you have another suggestion, I would be happy to hear it.
It seems there are a lot of suggestions about this:
When I accidentally navigate away from the editor, there's no mechanism which asks me whether I want to really leave the page and lose my edits.
I tried to drag&drop an image from my desktop to the editor, but because I didn't point exactly, the browser thought I wanted to open the image, and navigated away from the editor. After pressing the back-button, my edits were lost.