svelte-dnd-action
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -29,3 +29,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.5.2", | ||
"version": "0.5.3", | ||
"repository": { | ||
@@ -32,0 +32,0 @@ "type": "git", |
@@ -19,2 +19,3 @@ const TRANSITION_DURATION_SECONDS = 0.2; | ||
const draggedEl = originalElement.cloneNode(true); | ||
copyStylesFromTo(originalElement, draggedEl); | ||
draggedEl.id = `svelte-dnd-action-dragged-el`; | ||
@@ -72,2 +73,12 @@ draggedEl.name = `svelte-dnd-action-dragged-el`; | ||
/// other properties | ||
copyStylesFromTo(copyFromEl, draggedEl); | ||
transformDraggedElement(); | ||
} | ||
/** | ||
* | ||
* @param {HTMLElement} copyFromEl | ||
* @param {HTMLElement} copyToEl | ||
*/ | ||
function copyStylesFromTo(copyFromEl, copyToEl) { | ||
const computedStyle = window.getComputedStyle(copyFromEl); | ||
@@ -78,6 +89,4 @@ Array.from(computedStyle) | ||
.forEach(s => | ||
draggedEl.style.setProperty(s, computedStyle.getPropertyValue(s), computedStyle.getPropertyPriority(s)) | ||
copyToEl.style.setProperty(s, computedStyle.getPropertyValue(s), computedStyle.getPropertyPriority(s)) | ||
); | ||
transformDraggedElement(); | ||
} | ||
@@ -84,0 +93,0 @@ |
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
57202
1004