From 8b4bdf9489fbe8fc40357003ed2f10d7e974c90d Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Tue, 21 May 2019 21:57:34 +0200 Subject: [PATCH] more documentation for navigate away pompt js util closes #377 --- static/js/utils/form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/utils/form.js b/static/js/utils/form.js index 3cbbbd852..ed8b0fa9a 100644 --- a/static/js/utils/form.js +++ b/static/js/utils/form.js @@ -308,6 +308,8 @@ } function beforeUnloadHandler(event) { + // allow the event to happen if the form was not touched by the + // user or the unload event was initiated by a form submit if (!touched || unloadDueToSubmit) { return false; }