From: Bill Erickson Date: Tue, 6 Feb 2018 19:35:30 +0000 (-0500) Subject: LP#1730752 Grid column move-to-last fix X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=390de391541e2d868104fe93074d9039c393c62e;p=working%2FEvergreen.git 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 --- 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.