Displays a progress bar while waiting for results from a patron search
in the browser client. Bar only displays when a server-side search is
required. (It's not displayed for cached searches, etc.). Results grid
is hidden while the progress bar is visible and vice versa.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jeanette Lundgren <jlundgren@cwmars.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
+
+<!-- patron search progress bar -->
+<div class="row" ng-show="show_search_progress">
+ <div class="col-md-6">
+ <div class="progress progress-striped active">
+ <div class="progress-bar" role="progressbar" aria-valuenow="100"
+ aria-valuemin="0" aria-valuemax="100" style="width: 100%">
+ <span class="sr-only">[% l('Loading...') %]</span>
+ </div>
+ </div>
+ </div>
+</div>
+
+<!-- patron search results grid -->
<eg-grid
+ ng-hide="show_search_progress"
idl-class="au" id-field="id"
features="-sort,-display,-multisort"
main-label="[% l('Patron Search Results') %]"
return deferred.promise;
}
+ // Dispay the search progress bar to indicate a search is in progress
+ $scope.show_search_progress = true;
+
patronSvc.patrons = [];
egCore.net.request(
'open-ils.actor',
fullSearch.offset
).then(
- function() { deferred.resolve() },
+ function() {
+ // hide progress bar on 0-hits searches
+ $scope.show_search_progress = false;
+ deferred.resolve();
+ },
null, // onerror
function(user) {
+ // hide progress bar as soon as the first result appears.
+ $scope.show_search_progress = false;
patronSvc.localFlesh(user); // inline
patronSvc.patrons.push(user);
deferred.notify(user);