webstaff: tweak egGrid's row-click handler
authorGalen Charlton <gmc@esilibrary.com>
Mon, 25 Jan 2016 18:55:23 +0000 (13:55 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 25 Jan 2016 18:55:23 +0000 (13:55 -0500)
With this patch, multiselect-enabled grids now *toggle*
the selection status of affected rows, rather than select
only that row while deselecting the rest. This in turn
allows the double-click handler (if supplied) to act on
all selected rows if it wants to.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/staff/services/grid.js

index d02841e..f59418e 100644 (file)
@@ -795,7 +795,11 @@ angular.module('egGridMod',
                     }
                         
                 } else {
-                    grid.selectOneItem(index);
+                    if ($scope.canMultiSelect) {
+                        grid.toggleSelectOneItem(index);
+                    } else {
+                        grid.selectOneItem(index);
+                    }
                     grid.lastSelectedItemIndex = index;
                 }
             }