24 lines
592 B
JavaScript
Executable File
24 lines
592 B
JavaScript
Executable File
$(document).ready(function()
|
|
{
|
|
$.setAjaxForm('#childForm');
|
|
|
|
var initSortable = function()
|
|
{
|
|
$('#childList').sortable({trigger: '.sort-handle', selector: '.category', dragCssClass: ''});
|
|
}
|
|
|
|
var setChildrenKey = function()
|
|
{
|
|
maxID = v.maxID;
|
|
$('[value=new]').each(function()
|
|
{
|
|
maxID ++;
|
|
$(this).parents('.category').find('[id*=children]').attr('name', 'children[' + maxID + ']');
|
|
$(this).attr('name', 'mode[' + maxID + ']');
|
|
})
|
|
}
|
|
|
|
initSortable();
|
|
setChildrenKey();
|
|
});
|