$('.itemtree').sortable('destroy');
resequencing = false;
// get the LI item ids. Send them to the server.
- var new_sequence = $('.an_item').map(function() { return $(this).attr('id') });
- var new_seq_string = Array.join(new_sequence, ',');
- $.post('reseq', {'new_order':new_seq_string},
+ var new_sequence_str = '';
+ $('.an_item').each(function() { new_sequence_str += $(this).attr('id') + ' '; });
+ $.post('reseq', {'new_order':new_sequence_str},
function() {
$('#resequence_panel a').text($('#i18n-resequence-items').text());
alert($('#i18n-new-order-saved').text());
}
};
+var xxx = null;
+
function doToggleItemTree() {
if ($('.itemtree:hidden').length > 0) {
$('.itemtree:hidden').fadeIn(500);
# resequencing items
def _reseq(request, course, parent_heading):
- new_order = request.POST['new_order'].split(',')
+ new_order = request.POST['new_order'].strip().split(' ')
# new_order is now a list like this: ['item_3', 'item_8', 'item_1', ...].
# get at the ints.
new_order = [int(n.split('_')[1]) for n in new_order]