LP#1730752 Fix minor bug with move-to-last
authorRemington Steed <rjs7@calvin.edu>
Thu, 8 Feb 2018 13:28:53 +0000 (08:28 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 9 Feb 2018 16:55:49 +0000 (11:55 -0500)
If you click "Make last visible" on the column that is already the last
visible, it bumps it down one position when it should not move. This
commit adjusts the logic so that columns that are before or already in
the last-visible slot (thus, '<' or '=') will end up in the last-visible
slot, and columns only go after the last-visible slot if they are
already after it.

Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Bill Erickson <berickxx@gmail.com>

Open-ILS/web/js/ui/default/staff/services/grid.js

index 6b70e4b..266a972 100644 (file)
@@ -788,7 +788,7 @@ angular.module('egGridMod',
                     // Otherwise, put it into the slot directly following 
                     // the last visible column.
                     targetIdx = 
-                        srcIdx < lastVisible ? lastVisible : lastVisible + 1;
+                        srcIdx <= lastVisible ? lastVisible : lastVisible + 1;
                 }
 
                 // Splice column out of old position, insert at new position.