svelte-dnd-action
Advanced tools
Comparing version 0.9.20 to 0.9.21
@@ -43,3 +43,3 @@ { | ||
"description": "*An 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.9.20", | ||
"version": "0.9.21", | ||
"repository": { | ||
@@ -46,0 +46,0 @@ "type": "git", |
import {SHADOW_ELEMENT_ATTRIBUTE_NAME, DRAGGED_ELEMENT_ID} from "../constants"; | ||
import {findCenter} from "./intersection"; | ||
import { svelteNodeClone } from "./svelteNodeClone"; | ||
import {svelteNodeClone} from "./svelteNodeClone"; | ||
@@ -68,5 +68,5 @@ const TRANSITION_DURATION_SECONDS = 0.2; | ||
* @param {number} currentMouseY | ||
* @param {function} transformDraggedElement - function to transform the dragged element, does nothing by default. | ||
*/ | ||
export function morphDraggedElementToBeLike(draggedEl, copyFromEl, currentMouseX, currentMouseY, transformDraggedElement) { | ||
export function morphDraggedElementToBeLike(draggedEl, copyFromEl, currentMouseX, currentMouseY) { | ||
copyStylesFromTo(copyFromEl, draggedEl); | ||
const newRect = copyFromEl.getBoundingClientRect(); | ||
@@ -86,6 +86,2 @@ const draggedElRect = draggedEl.getBoundingClientRect(); | ||
} | ||
/// other properties | ||
copyStylesFromTo(copyFromEl, draggedEl); | ||
transformDraggedElement(); | ||
} | ||
@@ -92,0 +88,0 @@ |
@@ -300,3 +300,3 @@ import { | ||
dz.remove(); | ||
}) | ||
}); | ||
scheduledForRemovalAfterDrop = []; | ||
@@ -518,6 +518,5 @@ } | ||
if (idx === shadowElIdx) { | ||
config.transformDraggedElement(draggedEl, draggedElData, idx); | ||
if (!morphDisabled) { | ||
morphDraggedElementToBeLike(draggedEl, draggableEl, currentMousePosition.x, currentMousePosition.y, () => | ||
config.transformDraggedElement(draggedEl, draggedElData, idx) | ||
); | ||
morphDraggedElementToBeLike(draggedEl, draggableEl, currentMousePosition.x, currentMousePosition.y); | ||
} | ||
@@ -559,3 +558,3 @@ decorateShadowEl(draggableEl); | ||
} else { | ||
destroyDz(); | ||
destroyDz(); | ||
} | ||
@@ -562,0 +561,0 @@ } |
Sorry, the diff of this file is too big to display
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
6670
281278