svelte-dnd-action
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -139,3 +139,3 @@ (function (global, factory) { | ||
} | ||
const children = collectionBelowEl.childNodes; | ||
const children = collectionBelowEl.children; | ||
// the container is empty, floating element should be the first | ||
@@ -598,3 +598,3 @@ if (children.length === 0) { | ||
const {index, isProximityBased} = e.detail.indexObj; | ||
shadowElIdx = (isProximityBased && index === e.currentTarget.childNodes.length - 1)? index + 1 : index; | ||
shadowElIdx = (isProximityBased && index === e.currentTarget.children.length - 1)? index + 1 : index; | ||
shadowElDropZone = e.currentTarget; | ||
@@ -646,3 +646,3 @@ items.splice( shadowElIdx, 0, shadowElData); | ||
dispatchFinalizeEvent(shadowElDropZone, items); | ||
shadowElDropZone.childNodes[shadowElIdx].style.visibility = ''; | ||
shadowElDropZone.children[shadowElIdx].style.visibility = ''; | ||
cleanupPostDrop(); | ||
@@ -664,3 +664,3 @@ isWorkingOnPreviousDrag = false; | ||
dispatchFinalizeEvent(originDropZone, items); | ||
shadowElDropZone.childNodes[shadowElIdx].style.visibility = ''; | ||
shadowElDropZone.children[shadowElIdx].style.visibility = ''; | ||
cleanupPostDrop(); | ||
@@ -675,3 +675,3 @@ isWorkingOnPreviousDrag = false; | ||
function animateDraggedToFinalPosition(callback) { | ||
const shadowElRect = shadowElDropZone.childNodes[shadowElIdx].getBoundingClientRect(); | ||
const shadowElRect = shadowElDropZone.children[shadowElIdx].getBoundingClientRect(); | ||
const newTransform = { | ||
@@ -805,4 +805,4 @@ x: shadowElRect.left - parseFloat(draggedEl.style.left), | ||
dzToConfig.set(node, config); | ||
for (let idx=0; idx< node.childNodes.length; idx++) { | ||
const draggableEl = node.childNodes[idx]; | ||
for (let idx=0; idx< node.children.length; idx++) { | ||
const draggableEl = node.children[idx]; | ||
styleDraggable(draggableEl); | ||
@@ -809,0 +809,0 @@ if (config.items[idx].hasOwnProperty('isDndShadowItem')) { |
@@ -33,3 +33,3 @@ { | ||
"description": "*Awesome drag and drop library for Svelte 3 (not using the browser's built in dnd, thanks god): Rich animations, nested containers, touch support and more *", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"dependencies": { | ||
@@ -36,0 +36,0 @@ "acorn": "^7.1.1", |
@@ -85,3 +85,3 @@ import { observe, unobserve } from './helpers/observer'; | ||
const {index, isProximityBased} = e.detail.indexObj; | ||
shadowElIdx = (isProximityBased && index === e.currentTarget.childNodes.length - 1)? index + 1 : index; | ||
shadowElIdx = (isProximityBased && index === e.currentTarget.children.length - 1)? index + 1 : index; | ||
shadowElDropZone = e.currentTarget; | ||
@@ -133,3 +133,3 @@ items.splice( shadowElIdx, 0, shadowElData); | ||
dispatchFinalizeEvent(shadowElDropZone, items); | ||
shadowElDropZone.childNodes[shadowElIdx].style.visibility = ''; | ||
shadowElDropZone.children[shadowElIdx].style.visibility = ''; | ||
cleanupPostDrop(); | ||
@@ -151,3 +151,3 @@ isWorkingOnPreviousDrag = false; | ||
dispatchFinalizeEvent(originDropZone, items); | ||
shadowElDropZone.childNodes[shadowElIdx].style.visibility = ''; | ||
shadowElDropZone.children[shadowElIdx].style.visibility = ''; | ||
cleanupPostDrop(); | ||
@@ -162,3 +162,3 @@ isWorkingOnPreviousDrag = false; | ||
function animateDraggedToFinalPosition(callback) { | ||
const shadowElRect = shadowElDropZone.childNodes[shadowElIdx].getBoundingClientRect(); | ||
const shadowElRect = shadowElDropZone.children[shadowElIdx].getBoundingClientRect(); | ||
const newTransform = { | ||
@@ -292,4 +292,4 @@ x: shadowElRect.left - parseFloat(draggedEl.style.left), | ||
dzToConfig.set(node, config); | ||
for (let idx=0; idx< node.childNodes.length; idx++) { | ||
const draggableEl = node.childNodes[idx]; | ||
for (let idx=0; idx< node.children.length; idx++) { | ||
const draggableEl = node.children[idx]; | ||
styleDraggable(draggableEl); | ||
@@ -296,0 +296,0 @@ if (config.items[idx].hasOwnProperty('isDndShadowItem')) { |
@@ -18,3 +18,3 @@ import { isCenterOfAInsideB, calcDistanceBetweenCenters } from './intersection'; | ||
} | ||
const children = collectionBelowEl.childNodes; | ||
const children = collectionBelowEl.children; | ||
// the container is empty, floating element should be the first | ||
@@ -21,0 +21,0 @@ if (children.length === 0) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108753