This commit is contained in:
Dan Harrin
2023-11-26 12:56:35 +00:00
parent c42323612e
commit 27f8a4653f
2 changed files with 8 additions and 2 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -4,11 +4,17 @@ window.Sortable = Sortable
export default (Alpine) => {
Alpine.directive('sortable', (el) => {
let animation = parseInt(el.dataset?.sortableAnimationDuration)
if ((animation !== 0) && (! animation)) {
animation = 300
}
el.sortable = Sortable.create(el, {
draggable: '[x-sortable-item]',
handle: '[x-sortable-handle]',
dataIdAttr: 'x-sortable-item',
animation: parseInt(el.dataset?.sortableAnimationDuration) || 300,
animation: animation,
ghostClass: 'fi-sortable-ghost',
})
})