wesnolte/jOrgChart — pull request #17 by ja-jo (2012-03-24 14:28:17+00:00)
Title: Improved handling of none ID lists

I wanted to use your plugin in a project, however I have lots of li elements where they would not have IDs and would have exactly the same contents as other elements in the list therefore the way you were searching for list elements based on the contents of the element was not working.

So I altered the source to use the HTML5 data- attributes to store a node count on each li and div.node in the form of data-tree-node=1 and then when the drop event is raised I can link the two elements by using the jquery attribute selector and data() methods like so:

var sourceLi = $this.find("[data-tree-node=" + ui.draggable.data("tree-node") + "]");

I also made one other minor change which is I switched draggable's revert option to 'invalid' which I think works a lot better, however you may disagree.