From c5670d423867fd13ca1e175bde954836b69e3b75 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 2 Dec 2014 17:28:01 -0500 Subject: [PATCH] LP#1402797 Browser client checkout 'Done' clears current user Clicking the 'Done' button after checkout resets the patron side bar and action tabs to completely hide the previous patron's data. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier --- .../js/ui/default/staff/circ/patron/app.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index b51a11071b..d1ebcfc9a6 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -249,6 +249,15 @@ function($q , $timeout , $location , egCore, egUser , $locale) { return service.setPrimary(service.current.id(), null, true); } + // clear the currently focused user + service.clearPrimary = function() { + // reset with no patron + service.resetPatronLists(); + service.current = null; + service.patron_stats = null; + return $q.when(); + } + // sets the primary display user, fetching data as necessary. service.setPrimary = function(id, user, force) { var user_id = id ? id : (user ? user.id() : null); @@ -328,11 +337,10 @@ function($q , $timeout , $location , egCore, egUser , $locale) { ); } else { - // reset with no patron - service.resetPatronLists(); - service.current = null; - service.patron_stats = null; - return $q.when(); + // fetching a null user clears the primary user. + // NOTE: this should probably reject() and log an error, + // but calling clear for backwards compat for now. + return service.clearPrimary(); } } @@ -617,7 +625,7 @@ function($scope, $q, $location , $filter, egCore, egUser, patronSvc) { ['$scope','$location','egCore','egConfirmDialog','egUser','patronSvc', function($scope , $location , egCore , egConfirmDialog , egUser , patronSvc) { $scope.selectMe = true; // focus text input - patronSvc.setPrimary(); // clear the default user + patronSvc.clearPrimary(); // clear the default user // jump to the patron checkout UI function loadPatron(user_id) { -- 2.43.2