From: SuperBFG7 Date: Thu, 22 Oct 2015 15:49:42 +0000 (+0200) Subject: merge branch touch X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=b59c06b9222d78f4eeeb9d4d1ea9ae6c195e4482;p=ympd.git merge branch touch --- b59c06b9222d78f4eeeb9d4d1ea9ae6c195e4482 diff --cc htdocs/js/mpd.js index 414d324,0b47d16..07f4c60 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@@ -245,26 -255,7 +258,23 @@@ function webSocketConnect() 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');