When using the bill grid, if one right clicks on a row and views full
details one is taken to the first selected row. Make the UI show
full details for the row being right clicked on. If no row is
clicked on show first selected item's details.
Signed-off-by: Mike Risher <mrisher@catalyte.io>
Changes to be committed:
modified: Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
modified: Open-ILS/web/js/ui/default/staff/services/grid.js
// direct the user to the transaction details page
$scope.showFullDetails = function(all) {
- if (all[0])
+ var lastClicked = $scope.gridControls.contextMenuItem();
+ if (lastClicked) {
+ $location.path('/circ/patron/' +
+ patronSvc.current.id() + '/bill/' + lastClicked + '/statement');
+ } else if (all[0]) {
$location.path('/circ/patron/' +
patronSvc.current.id() + '/bill/' + all[0].id + '/statement');
+ }
+
}
$scope.activateBill = function(xact) {
return grid.columnsProvider;
}
+ controls.contextMenuItem = function() {
+ return $scope.contextMenuItem;
+ }
+
// link in the control functions
controls.selectedItems = function() {
return grid.getSelectedItems()
if(s.hasOwnProperty('item')){ break; }
e = e.parentElement;
}
+
+ $scope.contextMenuItem = grid.indexValue(s.item);
+
// select the right-clicked row if it is not already selected (lp1776557):
if(!$scope.selected[grid.indexValue(s.item)]){ $event.target.click(); }