mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
wip
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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',
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user