bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
22.01k stars 1.97k forks source link

dragula dragging in jquery #593

Closed frontend-stunntech closed 4 years ago

frontend-stunntech commented 5 years ago

hi, i am using dragula in jquery to drag and drop some widgets and container but i need to drag only in one direction mean in y-axis(up and down only). how can i do this?

$(document).ready(function () { dragula([document.querySelector('.containers')], { direction: function(el, target, source, sibling) { //logic here return 'horizontal'; }, moves: function (el, source, handle, sibling) { console.log(handle) if (handle.classList.contains('task-header')) { return true; } return false; $('.task-header').draggable({ axis: "y" });

            }