diff options
author | Shivam Dixit <shivamd001@gmail.com> | 2014-06-01 20:40:18 +0400 |
---|---|---|
committer | Shivam Dixit <shivamd001@gmail.com> | 2014-06-01 20:40:18 +0400 |
commit | db2c3ef25ab6d177ddeac92bdec2a6d129df13c8 (patch) | |
tree | 17956097ba1a010bd3762f6a5e0e4a1b641d38d1 /js/tbl_change.js | |
parent | 398e7654b23d6cdf0596244a26133ceb3751edb9 (diff) |
Added comments to bug fix #4415
Signed-off-by: Shivam Dixit <shivamd001@gmail.com>
Diffstat (limited to 'js/tbl_change.js')
-rw-r--r-- | js/tbl_change.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js/tbl_change.js b/js/tbl_change.js index d3646c9990..af6ef5f665 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -258,8 +258,14 @@ AJAX.registerTeardown('tbl_change.js', function () { AJAX.registerOnload('tbl_change.js', function () { $.datepicker.initialized = false; + // State of the form var $unsavedForm = false; + /** + * If user navigates away from the page + * without saving the changes, a prompt + * will be displayed to confirm navigation + */ $('a').on('click', function(e){ e.preventDefault(); @@ -274,6 +280,9 @@ AJAX.registerOnload('tbl_change.js', function () { } }); + /** + * If any form elements are changed, set $unsavedForm to true + */ $("form#insertForm :input:not([type=hidden])").change(function(){ $unsavedForm = true; }); |