xxb/module/tree/js/children.js
2023-10-23 15:51:36 +08:00

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();
});