I`m trying to disable jquery sortable on a list of items when there is only one item remaining in the list. Here is my code so far:
$(".draggable_teams").sortable({
handle: '.team-header .grabber',
revert: 100,
tolerance: 'pointer',
connectWith: '.draggable-team-connector',
placeholder: 'highlight-teams',
helper: function (e, ul) {
var $originals = ul.children();
var $helper = ul.clone();
$($helper).find("[teamorder='teamorder']").addClass('clone-teams');
$helper.children().each(function (index) {
$(this).width($originals.eq(index).width())
});
return $helper;
},
start: function (ul) {
$('.clone-teams .team').slideUp(400);
},
update: function () {
updateListScope();
scope.saveTeamOrder();
}
}).disableSelection();
}
Any help at all would be greatly appreciated :) Thanks.