Skip to content

Commit

Permalink
removes console logs, sets state with handle sort after action.
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamilenkovic committed Jan 9, 2024
1 parent c988c58 commit 7086495
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/actionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export function handleSort(data: NodeEventData) {
}
}

data.targetData.parent.data.config.sort(data);

State.lastValue = data.targetData.node.data.value;

State.lastCoordinates = { x: clientX, y: clientY };
Expand All @@ -37,6 +39,4 @@ export function handleSort(data: NodeEventData) {
data.targetData.node.data.index > State.draggedNodes[0]?.data.index
? 1
: -1;

data.targetData.parent.data.config.sort(data);
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function remapNodes(parent: HTMLElement) {
}

const values = parentData.getValues(parent);
console.log("enabled nodes", enabledNodes);

for (let x = 0; x < enabledNodes.length; x++) {
const child = enabledNodes[x];

Expand Down
4 changes: 1 addition & 3 deletions src/plugins/dropZones/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ function handleDrop(eventData: DropZoneEventData) {
}

function handleTransfer(eventData: DropZoneEventData) {
if (State.lastParent?.el !== eventData.targetData.parent.el) {
if (State.lastParent?.el !== eventData.targetData.parent.el)
transfer(eventData);
}

State.lastParent = eventData.targetData.parent;
}
Expand All @@ -30,7 +29,6 @@ export function dropZone(dzConfig: Partial<DropZoneConfig>) {

return {
tearDown() {
console.log("tear down", parentData);
parentData.config.dropZones = [];

Data.parents.set(parent, parentData);
Expand Down

0 comments on commit 7086495

Please sign in to comment.