From b2262e225f8ffe21f607b39869e46e37c10af268 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 6 Feb 2018 14:35:30 -0500 Subject: [PATCH] LP#1730752 Grid column move-to-last fix Grid column manager "move to last visible" now moves the column correctly to the last visible slot instead of one slot after the last visible slot. Signed-off-by: Bill Erickson Signed-off-by: Remington Steed --- Open-ILS/web/js/ui/default/staff/services/grid.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 3f7a9dff85..6b70e4bedb 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -781,7 +781,14 @@ angular.module('egGridMod', if (column.visible) lastVisible = idx; } ); - targetIdx = lastVisible + 1; + + // When moving a column (down) causes one or more + // visible columns to shuffle forward, our column + // moves into the slot of the last visible column. + // Otherwise, put it into the slot directly following + // the last visible column. + targetIdx = + srcIdx < lastVisible ? lastVisible : lastVisible + 1; } // Splice column out of old position, insert at new position. -- 2.43.2