latin-language-toolkit/arethusa — pull request #286 by LFDM (2014-07-24 19:01:28+00:00)
Title: Prompt on leave when changes are unsaved

Closes #263

We are annoying and prompt the user everytime he wants to leave our application when he has unsaved changes.

Code for this is a bit sad - we basically need to define two event handlers here: One for the regular window `beforeunload` event and one for changes within the angular `$location` service.

We are tracking now through `state` if we are in something like a debug mode or not, by passing a `debug` boolean property to the configuration of `main`.

That way we can disable such prompting during development, which can be very very annoying when we are using a live-reload server...