Skip to content
Snippets Groups Projects
Unverified Commit eaca2bb8 authored by Chris Lawton's avatar Chris Lawton Committed by GitHub
Browse files

Merge pull request #1218 from OpenTechFund/feature/1214-warn-before-exit

warn the user of unsaved changes if they try to leave the page whilst…
parents d5536e22 0b1dcbbf
No related branches found
No related tags found
No related merge requests found
......@@ -142,4 +142,11 @@
const hideError = () => $(commentError).remove();
window.addEventListener('beforeunload', (e) => {
if ($(submitEditButton).length) {
e.preventDefault();
e.returnValue = 'It looks like you\'re still editing a comment. Are you sure you want to leave?';
}
});
})(jQuery);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment