Side navigation
Ticket #2594: sortablejs.txt
File sortablejs.txt, 0.5 KB (added by kylebragger, March 27, 2008 12:24PM UTC)
javascript being used to generate the sortable
$(document).ready(
function ()
{
$('#song_list').Sortable({
accept: 'song',
tolerance: 'intersect',
handle: '.drag',
floats: true,
axis: 'vertically',
helperclass: 'sorthelper',
onStop: function(ser)
{
// Serialize the order and update
var sorted = $.SortSerialize('song_list');
var ids = sorted.hash
.replace(/song_/g, '')
.replace(/list\[\]\=/g, '')
.split('&').join('~');
$.post('/playlists/update_sort/<?= $playlist->id; ?>', {id: <?= $playlist->id; ?>, ids: ids});
}
});
}
);
Download in other formats:
Original Format
File sortablejs.txt, 0.5 KB (added by kylebragger, March 27, 2008 12:24PM UTC)
javascript being used to generate the sortable
$(document).ready(
function ()
{
$('#song_list').Sortable({
accept: 'song',
tolerance: 'intersect',
handle: '.drag',
floats: true,
axis: 'vertically',
helperclass: 'sorthelper',
onStop: function(ser)
{
// Serialize the order and update
var sorted = $.SortSerialize('song_list');
var ids = sorted.hash
.replace(/song_/g, '')
.replace(/list\[\]\=/g, '')
.split('&').join('~');
$.post('/playlists/update_sort/<?= $playlist->id; ?>', {id: <?= $playlist->id; ?>, ids: ids});
}
});
}
);