@itrocks/table 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/column-reorder.js CHANGED
@@ -19,8 +19,6 @@ export class TableColumnReorder extends Plugin {
19
19
  const scrollDirection = this.scroll(drag, time);
20
20
  if (scrollDirection)
21
21
  this.requestFrame();
22
- if (drag.remove)
23
- return;
24
22
  const direction = pointerDirection || scrollDirection;
25
23
  const target = direction ? this.target(drag, direction) : drag.index;
26
24
  if (target !== drag.index)
@@ -89,8 +87,9 @@ export class TableColumnReorder extends Plugin {
89
87
  }
90
88
  move(drag, targetIndex) {
91
89
  const after = drag.index < targetIndex;
92
- for (const cell of drag.cells) {
93
- const target = cell.parentElement.cells[targetIndex];
90
+ for (const row of this.rows()) {
91
+ const cell = row.cells[drag.index];
92
+ const target = row.cells[targetIndex];
94
93
  after ? target.after(cell) : target.before(cell);
95
94
  }
96
95
  if (drag.col) {
package/package.json CHANGED
@@ -52,5 +52,5 @@
52
52
  "scripts": {
53
53
  "build": "tsc && sass --no-source-map demo:demo && node ../prepare-module/prepare-module.js"
54
54
  },
55
- "version": "0.2.8"
55
+ "version": "0.2.9"
56
56
  }