socket.send('MPD_API_PLAY_TRACK,'+$(this).attr('trackid'));
$(this).addClass('active');
},
- mouseleave: function(){
- $(this).children().last().find("a").stop().remove();
- }
});
+ //Helper function to keep table row from collapsing when being sorted
+ var fixHelperModified = function(e, tr) {
+ var $originals = tr.children();
+ var $helper = tr.clone();
+ $helper.children().each(function(index)
+ {
+ $(this).width($originals.eq(index).width())
+ });
+ return $helper;
+ };
+
+ //Make queue table sortable
+ $("#salamisandwich > tbody").sortable({
+ helper: fixHelperModified,
+ stop: function(event,ui) {renumber_table('#salamisandwich',ui.item)}
+ }).disableSelection();
break;
case "search":
$('#wait').modal('hide');