From c2966f46fdeb28fa316caea16ccd8fdd40bb79e7 Mon Sep 17 00:00:00 2001 From: Mahen Seneviratne Date: Wed, 31 Oct 2018 01:46:49 -0400 Subject: [PATCH] fix draggable columns --- addon/mixins/draggable-column.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addon/mixins/draggable-column.js b/addon/mixins/draggable-column.js index 43716872..b464a91a 100644 --- a/addon/mixins/draggable-column.js +++ b/addon/mixins/draggable-column.js @@ -125,8 +125,7 @@ export default Mixin.create({ let table = this.get('table'); let columns = this.get('dragColumnGroup'); - let _columns = columns.toArray(); - let targetColumnIdx = _columns.indexOf(targetColumn); + let targetColumnIdx = columns.indexOf(targetColumn); e.dataTransfer.dropEffect = 'move'; e.preventDefault(); @@ -134,9 +133,8 @@ export default Mixin.create({ table.propertyWillChange('columns'); - _columns.removeObject(sourceColumn); - _columns.insertAt(targetColumnIdx, sourceColumn); - columns.setObjects(_columns); + columns.removeObject(sourceColumn); + columns.insertAt(targetColumnIdx, sourceColumn); table.propertyDidChange('columns');