circ list is meant to display -->
<ul class="nav nav-tabs">
<li ng-class="{active : items_out_display == 'main'}">
- <a href ng-click="show_main_list()">
+ <a href ng-click="show_main_list(items_out_display=='alt')">
[% l('Items Checked Out') %] ({{main_list.length}})
</a>
</li>
<li ng-if="show_alt_circs" ng-class="{active : items_out_display == 'alt'}">
- <a href ng-click="show_alt_list()">
+ <a href ng-click="show_alt_list(items_out_display=='main')">
[% l('Other/Special Circulations') %] ({{alt_list.length}})
</a>
</li>
}
$scope.items_out_display = 'main';
- $scope.show_main_list = function() {
+ $scope.show_main_list = function(refresh_grid) {
// don't need a full reset_page() to swap tabs
$scope.items_out_display = 'main';
patronSvc.items_out = [];
- provider.refresh();
+ // only refresh the grid when navigating from a tab that
+ // shares the same grid.
+ if (refresh_grid) provider.refresh();
}
- $scope.show_alt_list = function() {
+ $scope.show_alt_list = function(refresh_grid) {
// don't need a full reset_page() to swap tabs
$scope.items_out_display = 'alt';
patronSvc.items_out = [];
- provider.refresh();
+ // only refresh the grid when navigating from a tab that
+ // shares the same grid.
+ if (refresh_grid) provider.refresh();
}
$scope.show_noncat_list = function() {
// don't need a full reset_page() to swap tabs
$scope.items_out_display = 'noncat';
patronSvc.items_out = [];
- provider.refresh();
+ // Grid refresh is not necessary because switching to the
+ // noncat_list always involves instantiating a new grid.
}
// Reload the user to pick up changes in items out, fines, etc.
patronSvc.items_out = [];
$scope.main_list = [];
$scope.alt_list = [];
- provider.refresh()
+ $timeout(provider.refresh); // allow scope changes to propagate
}
var provider = egGridDataProvider.instance({});
var id_list = $scope[$scope.items_out_display + '_list'];
// see if we have the requested range cached
+ // Note this items_out list is reset w/ each items-out tab change
if (patronSvc.items_out[offset]) {
return provider.arrayNotifier(
patronSvc.items_out, offset, count);