1.9.9 - Drag and drop sorting

This commit is contained in:
Trevor Squillario 2012-05-22 11:14:42 -04:00
parent e94854faff
commit bab5923c64
6 changed files with 51 additions and 14 deletions

View file

@ -248,7 +248,7 @@
$('table.songlist tr.song a.remove').live('click', function (event) {
var track = $(this).parent().parent();
$(track).remove();
refreshRowColor();
refreshRowColor('table.songlist');
return false;
});
$('table.songlist tr.song a.rate').live('click', function (event) {
@ -349,8 +349,8 @@
});
// Current Playlist Click Events
$('#action_Shuffle').live('click', function () {
$('#CurrentPlaylistContainer tr.song').shuffle();
refreshRowColor();
$('#CurrentPlaylistContainer tbody tr.song').shuffle();
refreshRowColor('#CurrentPlaylistContainer tbody');
return false;
});
$('#action_Empty').live('click', function () {
@ -448,8 +448,8 @@
return false;
});
$('#action_ShufflePlaylist').live('click', function () {
$('#TrackContainer tr.song').shuffle();
refreshRowColor();
$('#TrackContainer tbody tr.song').shuffle();
refreshRowColor('#TrackContainer tbody');
return false;
});
@ -593,4 +593,24 @@
return false;
});
// JQuery UI Sortable - Drag and drop sorting
var fixHelper = function (e, ui) {
ui.children().each(function () {
$(this).width($(this).width());
});
return ui;
};
$("#CurrentPlaylistContainer tbody").sortable({
helper: fixHelper,
stop: function() {
refreshRowColor('#CurrentPlaylistContainer tbody');
}
}).disableSelection();
$("#TrackContainer tbody").sortable({
helper: fixHelper,
stop: function () {
refreshRowColor('#TrackContainer tbody');
}
}).disableSelection();
}); // End document.ready