Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dragula - always drag to the list end #90

Open
Rdepaula0 opened this issue Sep 28, 2016 · 0 comments
Open

dragula - always drag to the list end #90

Rdepaula0 opened this issue Sep 28, 2016 · 0 comments

Comments

@Rdepaula0
Copy link

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/)]

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();
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant