From 593fbaacc685000497834b2b9d5d63214928f60e 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 --- 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 34c6c4a577..1a706b6b87 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -199,6 +199,7 @@ function($window , egStrings) { // handle page change $($window).on('beforeunload', function() { + service.clear(); return msg || egStrings.EG_UNLOAD_PAGE_PROMPT_MSG; }); @@ -208,8 +209,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