You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the dragula.js and needed to set up that when you drag any object to another list, it goes to the end. Even if I drop anywhere he goes to the end of the list.
Does anyone have any idea how can I do this? Already researched in various locations and without any success.
this is an example, but that only works clicking on the item needed to do work when dragged.
[(http://jsfiddle.net/vf6dnwxj/11/)]
drake = dragula([left1, right1]);
drake.on('drop', function(el, target, source, sibling){
});
var leftList = document.querySelector('#left1');
var rightList = document.querySelector('#right1');
var list = document.querySelectorAll('#right1 li, #left1 li');
for (var i = 0; i < list.length; i++) {
list[i].addEventListener('click', function(){
drake.start(this);
if (this.parentNode.id == 'right1') {
leftList.appendChild(this);
} else {
rightList.appendChild(this);
}
drake.end();
});
}
The text was updated successfully, but these errors were encountered:
I need some help.
I am using the dragula.js and needed to set up that when you drag any object to another list, it goes to the end. Even if I drop anywhere he goes to the end of the list.
Does anyone have any idea how can I do this? Already researched in various locations and without any success.
this is an example, but that only works clicking on the item needed to do work when dragged.
[(http://jsfiddle.net/vf6dnwxj/11/)]
The text was updated successfully, but these errors were encountered: