iamapinan / nestedsortables

Automatically exported from code.google.com/p/nestedsortables
GNU General Public License v2.0
0 stars 0 forks source link

NestedSortables fails if top ul element don't have any class name #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create UL list with top element without any ClassName
2. Add some extra html tags inside <li> element 
   This is important. don't just have <li>item1</li>
   Try to have <li><div>item1</div></li>
3. View it in browser and move the elements around.
4. You will find the whole tree getting disturbed.

////////html//////////////

<ul id="TodoList" >
    <li class='Todo' id='t1'><div id='m1' class='axx'>Test1</div></li>
    <li class='Todo' id='t2'><div id='m2' class='axx'>Test2</div></li>
    <li class='Todo' id='t3'><div id='m3' class='axx'>Test3</div></li>
</ul>

////////script//////////////

$('#TodoList').NestedSortable(
     {
        helperclass : 'SortHelperClass',
        accept: 'Todo'
      }
    );

////////Debugging/////////////

I debugged further and found that , Top UL element's classname is used
in code for some manipulation. 

/* Line 503 nestedsortables.js */
this.nestedSortCfg.nestingTagClass = this.className;

This variable is used in 'nestItem' function
/* Line 384 nestedsortables.js */
var parentNesting = jQuery(parent).children(e.nestedSortCfg.nestingTag +
"." + e.nestedSortCfg.nestingTagClass.split(" ").join(".")
);

so above children() function fails and returns some other junk element in DOM.

Note: This may be a bug of Jquery children() function. But i am not sure.

regards,
palani

Original issue reported on code.google.com by pala...@gmail.com on 18 May 2008 at 2:42