st-tu-dresden / inloop

[Deprecated] A simple web application to manage online programming assignments
GNU General Public License v3.0
29 stars 8 forks source link

Show alert when leaving with unsaved changes #395

Closed julianctni closed 4 years ago

julianctni commented 4 years ago

Show a dialog box that warns the user that there are unsaved changes. The dialog only appears, when changes made to the code or new files were not saved yet. Used the "beforeunload" event of the window element. Implementation contains some legacy methods to make it work in all common browsers.

Fixes: #391

martinmo commented 4 years ago

Oh, and wouldn't it be better to put this also into the init() function? 🤔

martinmo commented 4 years ago

Oh, and wouldn't it be better to put this also into the init() function? 🤔

Nevermind, it should be okay as it is. I'll format and merge it.