From 3131f7151ddaab6e0a4e43fc196bb1903868d989 Mon Sep 17 00:00:00 2001 From: Katlyn Beck Date: Tue, 27 Nov 2018 21:15:11 +0000 Subject: [PATCH] lp1717366 toggle patron summary setting - Added function to manage state of summary based on circ.auto_hide_patron_summary Signed-off-by: Katlyn Beck Changes to be committed: modified: Open-ILS/web/js/ui/default/staff/circ/patron/app.js --- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 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 d007257e4f..7c3aefacec 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 @@ -357,14 +357,25 @@ function($scope, $q , $location , $filter , egCore , egNet , egUser , egAlertDi lNode.style.visibility = 'hidden'; } + function setSummaryState(condition) { + if (condition) { + egCore.hatch.setItem('eg.circ.patron.summary.collapse', true); + } else { + egCore.hatch.removeItem('eg.circ.patron.summary.collapse'); + } + } + + egCore.hatch.getItem('circ.auto_hide_patron_summary').then(function(res) { + setSummaryState(res); + }); + $scope.toggle_expand_summary = function() { if ($scope.collapsePatronSummary) { $scope.collapsePatronSummary = false; - egCore.hatch.removeItem('eg.circ.patron.summary.collapse'); } else { $scope.collapsePatronSummary = true; - egCore.hatch.setItem('eg.circ.patron.summary.collapse', true); } + setSummaryState($scope.collapsePatronSummary); } // always expand the patron summary in the search UI, regardless -- 2.11.0