2010-05-25 00:32:12 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
var updateContentsOrder = function() {
|
|
|
|
var list = $('ul#contents-list.sortable');
|
|
|
|
var ids = jQuery.map(list.sortable('toArray'), function(e) {
|
|
|
|
return e.match(/content-(\w+)/)[1];
|
|
|
|
}).join(',');
|
|
|
|
$('#order').val(ids || '');
|
|
|
|
}
|
|
|
|
|
|
|
|
$('ul#contents-list.sortable').sortable({
|
2010-05-26 00:41:10 +00:00
|
|
|
handle: 'em',
|
2010-05-25 00:32:12 +00:00
|
|
|
items: 'li.content',
|
|
|
|
stop: function(event, ui) { updateContentsOrder(); }
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|