webstaff: Unbreak grid feature detection
authorMike Rylander <mrylander@gmail.com>
Mon, 31 Aug 2015 17:22:10 +0000 (13:22 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Mon, 14 Sep 2015 19:44:17 +0000 (15:44 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/web/js/ui/default/staff/services/grid.js

index 5e399b0..02e462c 100644 (file)
@@ -126,14 +126,18 @@ angular.module('egGridMod',
                 $scope.actionGroups = [{actions:[]}]; // Grouped actions for selected items
                 $scope.menuItems = []; // global actions
 
-                $scope.showIndex = ($scope.features.indexOf('-index') == -1);
+                var features = ($scope.features) ? 
+                    $scope.features.split(',') : [];
+                delete $scope.features;
+
+                $scope.showIndex = (features.indexOf('-index') == -1);
 
-                $scope.startSelected = $scope.selectAll = ($scope.features.indexOf('startSelected') > -1);
-                $scope.showActions = ($scope.features.indexOf('-actions') == -1);
-                $scope.showPagination = ($scope.features.indexOf('-pagination') == -1);
-                $scope.showPicker = ($scope.features.indexOf('-picker') == -1);
+                $scope.startSelected = $scope.selectAll = (features.indexOf('startSelected') > -1);
+                $scope.showActions = (features.indexOf('-actions') == -1);
+                $scope.showPagination = (features.indexOf('-pagination') == -1);
+                $scope.showPicker = (features.indexOf('-picker') == -1);
 
-                $scope.showMenu = ($scope.features.indexOf('-menu') == -1);
+                $scope.showMenu = (features.indexOf('-menu') == -1);
 
                 // remove some unneeded values from the scope to reduce bloat
 
@@ -161,10 +165,6 @@ angular.module('egGridMod',
 
                 grid.dataProvider = $scope.itemsProvider;
 
-                var features = ($scope.features) ? 
-                    $scope.features.split(',') : [];
-                delete $scope.features;
-
                 if (!grid.indexField && grid.idlClass)
                     grid.indexField = egCore.idl.classes[grid.idlClass].pkey;