From 58579e840f471109abae23b28aa85a7c35ff992b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 18 May 2017 15:17:51 -0400 Subject: [PATCH] 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 it's easier for users to track the movement of a column. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../src/templates/staff/css/style.css.tt2 | 4 +++ .../src/templates/staff/share/t_autogrid.tt2 | 31 +++++++++++++++++- .../web/js/ui/default/staff/services/grid.js | 32 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index eff1037b0d..bfde50081b 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -358,6 +358,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; } -- 2.43.2