[open-ils-commits] [GIT] Evergreen ILS branch master updated. 536e5e8cd2a4c753c2a13e001d9d906fe57022a9

Evergreen Git git at git.evergreen-ils.org
Wed Aug 8 11:51:01 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  536e5e8cd2a4c753c2a13e001d9d906fe57022a9 (commit)
      from  457d7f65aeba76f7deb4581e8f3e1930aad4f592 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 536e5e8cd2a4c753c2a13e001d9d906fe57022a9
Author: a. bellenir <ab at grpl.org>
Date:   Tue Aug 7 18:18:41 2018 -0400

    LP#1785333: Right-click can clear grid selection
    
    This commit uses egGrid's indexValue API to identify the clicked row rather
    than depending on grid row order when checking whether the that row is
    currently selected.  This is a generalized fix for all grids.
    
    Signed-off-by: a. bellenir <ab at grpl.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js
index 4c2ff19..3f7aba3 100644
--- a/Open-ILS/web/js/ui/default/staff/services/grid.js
+++ b/Open-ILS/web/js/ui/default/staff/services/grid.js
@@ -681,23 +681,18 @@ angular.module('egGridMod',
                 if (!$scope.menu_dom) $scope.menu_dom = $($scope.grid_element).find('.grid-action-dropdown')[0];
                 if (!$scope.action_context_parent) $scope.action_context_parent = $($scope.menu_dom).parent();
 
-                // we need the index of the row that got right-clicked...
+                // we need the the row that got right-clicked...
                 var e = $event.target; // the DOM element
                 var s = undefined;     // the angular scope for that element
-                while(e){ // searching for the row so we can get its index from s.$index
+                while(e){ // searching for the row
                     // abort & use the browser default context menu for links (lp1669856):
                     if(e.tagName.toLowerCase() === 'a' && e.href){ return true; }
                     s = angular.element(e).scope();
                     if(s.hasOwnProperty('item')){ break; }
                     e = e.parentElement;
                 }
-                /* $scope.items and $scope.selected indexes are "backwards" to each other.
-                $scope.items counts down from the top of the list (most recent item first)
-                $scope.selected counts forward as items are scanned (most recent item last)
-                s.$index is for $scope.items. we need the index for $scope.selected: */
-                var selectable_index = ($scope.items.length-1) - s.$index;
                 // select the right-clicked row if it is not already selected (lp1776557):
-                if(!$scope.selected[selectable_index]){ $event.target.click(); }
+                if(!$scope.selected[grid.indexValue(s.item)]){ $event.target.click(); }
 
                 if (!$scope.action_context_showing) {
                     $scope.action_context_width = $($scope.menu_dom).css('width');

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/services/grid.js |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list