Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
swapAnimation: {
duration: 150,
easingFunction: 'ease-in-out',
},
mirror: {
appendTo: this.element,
constrainDimensions: true,
},
classes: {
'source:dragging': 'is-dragging-placeholder',
mirror: 'is-dragging'
},
plugins: [Plugins.SwapAnimation]
});
this.sortable.on('sortable:stop', this._reorderPlaylist);
}
connect () {
this.sortablePhotos = new Sortable(this.photosTarget, {
delay: 100,
classes: {
'source:dragging': 'draggable-dragging',
'mirror': 'draggable-mirror'
},
handle: '.draggable-handle',
plugins: [Plugins.SwapAnimation]
});
this.sortablePhotos.on('drag:start', event => this.startSort(event));
}
export default function PluginsSwapAnimation() {
const containers = document.querySelectorAll('#SwapAnimation .BlockLayout');
if (containers.length === 0) {
return false;
}
const sortable = new Sortable(containers, {
draggable: '.Block--isDraggable',
mirror: {
constrainDimensions: true,
},
plugins: [Plugins.SwapAnimation],
swapAnimation: {
duration: 200,
easingFunction: 'ease-in-out',
},
});
return sortable;
}