From 4ee999b8f89d2a41cac194e94b827b3085b5d876 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Sat, 16 Jan 2016 15:15:01 -0500 Subject: [PATCH] LP#1452950 Remove unsaved data warning after click-thru Once the user clicks through the unsaved data warning, clear the warning for future navigation. If more fields are changed, the warning will be reinstated. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/web/js/ui/default/staff/services/ui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 2ffbc22931..7f8466691a 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -202,6 +202,7 @@ function($window , egStrings) { // handle page change $($window).on('beforeunload', function() { + service.clear(); return msg || egStrings.EG_UNLOAD_PAGE_PROMPT_MSG; }); @@ -211,8 +212,13 @@ function($window , egStrings) { // similar to the page-page prompt. service.locChangeCancel = $scope.$on('$locationChangeStart', function(evt, next, current) { - if (!confirm(msg || egStrings.EG_UNLOAD_CTRL_PROMPT_MSG)) + if (confirm(msg || egStrings.EG_UNLOAD_CTRL_PROMPT_MSG)) { + // user allowed the page to change. + // Clear the unload handler. + service.clear(); + } else { evt.preventDefault(); + } }); }; -- 2.11.0