OdinaSpb / jstree

Automatically exported from code.google.com/p/jstree
0 stars 0 forks source link

Bug in online demo #899

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.Move (drag) a node down
2.Refresh tree
3.Node is now 1 position further down than it should be

Doesn't occur when moving nodes up, only down.

I first noticed this in my application as I borrowed the demo's code.
Seems to happen at all levels.

Original issue reported on code.google.com by glennala...@gmail.com on 16 Feb 2011 at 6:36

GoogleCodeExporter commented 9 years ago
My fix (more like hack) for the demo was to include the following lines which 
decrement the position if moving down.

.bind("move_node.jstree", function (e, data) {
    data.rslt.o.each(function (i) {

        if (data.rslt.p == "after")
            data.rslt.cp--;

Original comment by glennala...@gmail.com on 16 Feb 2011 at 7:42