From: Bill Erickson Date: Thu, 18 May 2017 19:17:51 +0000 (-0400) Subject: LP#1691801 Webstaff grid column move controls X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b527c483e6f5ee692d08b354fe4e8909c9fa748b;p=working%2FEvergreen.git LP#1691801 Webstaff grid column move controls Add options to grid "Configure Columns" interface for moving a column left or right by one, all the way left, and all the way right. Most recently modified column is styled so its easier for users to track the movement of a column. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index bdfd64dd5a..74de877521 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -381,6 +381,10 @@ table.list tr.selected td { /* deprecated? */ cursor: e-resize; } +.eg-grid-column-last-mod { + background-color: #78FA89; +} + .eg-grid-menu-item { margin-right: 10px; } diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index acf3b5cd41..cf5ac460a2 100644 --- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 @@ -218,6 +218,7 @@
[% l('Expand') %]
[% l('Shrink') %]
+
[% l('Left') %]
+
[% l('Right') %]
+
[% l('Far Left') %]
+
[% l('Far Right') %]
[% l('Sort') %]
+ + +
+
+ + + +
+
+ + + +
+
+
+
+ + + +
= grid.columnsProvider.columns.length) { + // Target index follows the last visible column. + var lastVisible = 0; + angular.forEach(grid.columnsProvider.columns, + function(column, idx) { + if (column.visible) lastVisible = idx; + } + ); + targetIdx = lastVisible + 1; + } + + // Splice column out of old position, insert at new position. + grid.columnsProvider.columns.splice(srcIdx, 1); + grid.columnsProvider.columns.splice(targetIdx, 0, col); + } + + $scope.modifyColumnPos = function(col, diff) { + $scope.lastModColumn = col.name; + return grid.modifyColumnPos(col, diff); + } + + // handles click, control-click, and shift-click $scope.handleRowClick = function($event, item) { var index = grid.indexValue(item); @@ -859,6 +890,7 @@ angular.module('egGridMod', $scope.showGridConf = true; } + delete $scope.lastModColumn; $scope.gridColumnPickerIsOpen = false; }