From 109138366b2312977446961426bce86a8b2a4a7a Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Wed, 24 Jul 2013 18:25:21 -0400 Subject: [PATCH] Range check column move. Delete dead code. Fixes #602 --- .../views/data-table/menu-edit-column.js | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js index 5cc67c84b..9208cfc56 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js @@ -70,15 +70,6 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { } ); }); - - var o = DataTableView.sampleVisibleRows(column); - var previewWidget = new ExpressionPreviewDialog.Widget( - elmts, - column.cellIndex, - o.rowIndices, - o.values, - null - ); }; var doAddColumnByFetchingURLs = function() { @@ -115,15 +106,6 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { ); dismiss(); }); - - var o = DataTableView.sampleVisibleRows(column); - var previewWidget = new ExpressionPreviewDialog.Widget( - elmts, - column.cellIndex, - o.rowIndices, - o.values, - null - ); }; var doRemoveColumn = function() { @@ -165,15 +147,18 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { }; var doMoveColumnBy = function(change) { - Refine.postCoreProcess( - "move-column", - { - columnName: column.name, - index: Refine.columnNameToColumnIndex(column.name) + change - }, - null, - { modelsChanged: true } - ); + var newidx = Refine.columnNameToColumnIndex(column.name) + change; + if (newidx > 0 && newidx < Refine.columnNameToColumnIndex(column.name)) { + Refine.postCoreProcess( + "move-column", + { + columnName: column.name, + index: newidx + }, + null, + { modelsChanged: true } + ); + } }; var doSplitColumn = function() {