I'm new with dragula. I'm using it with meteor.
The thing is, I want to save the new position of the element in MongoDB but for that I think I need to know what's the previous and the next element (their id is the id in the database)
I'm using this algorithm in the first post of this issue btw
https://github.com/bevacqua/dragula/issues/36
For the next element, it's easy it's just the sibling variable but for the previous one I'm stuck
When I do
sibling.previousSibling.id
it gets me the id of the element I just dropped. So I thought using:
Hi
I'm new with dragula. I'm using it with meteor. The thing is, I want to save the new position of the element in MongoDB but for that I think I need to know what's the previous and the next element (their id is the id in the database) I'm using this algorithm in the first post of this issue btw https://github.com/bevacqua/dragula/issues/36
For the next element, it's easy it's just the sibling variable but for the previous one I'm stuck
When I do
sibling.previousSibling.id
it gets me the id of the element I just dropped. So I thought using:
sibling.previousSibling.previousSibling.id
but it gets me an undefined element.
Does someone have an idea ?