Skip to content

Commit

Permalink
fix draggable columns
Browse files Browse the repository at this point in the history
  • Loading branch information
msenevir committed Oct 31, 2018
1 parent 9bd2db3 commit c2966f4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions addon/mixins/draggable-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,16 @@ 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();
e.stopPropagation();

table.propertyWillChange('columns');

_columns.removeObject(sourceColumn);
_columns.insertAt(targetColumnIdx, sourceColumn);
columns.setObjects(_columns);
columns.removeObject(sourceColumn);
columns.insertAt(targetColumnIdx, sourceColumn);

table.propertyDidChange('columns');

Expand Down

0 comments on commit c2966f4

Please sign in to comment.