From 6365d8fecefd7b1c4f96dbbf3743c8822e984d7c Mon Sep 17 00:00:00 2001 From: gfawcett Date: Fri, 1 May 2009 01:25:24 +0000 Subject: [PATCH] fixed 'Resequence' bug that was affecting Internet Explorer git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@426 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/static/menublocks.js | 8 +++++--- conifer/syrup/views/items.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conifer/static/menublocks.js b/conifer/static/menublocks.js index 5071b7f..836da7f 100644 --- a/conifer/static/menublocks.js +++ b/conifer/static/menublocks.js @@ -69,9 +69,9 @@ function doResequence() { $('.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()); @@ -79,6 +79,8 @@ function doResequence() { } }; +var xxx = null; + function doToggleItemTree() { if ($('.itemtree:hidden').length > 0) { $('.itemtree:hidden').fadeIn(500); diff --git a/conifer/syrup/views/items.py b/conifer/syrup/views/items.py index d984241..b0f9367 100644 --- a/conifer/syrup/views/items.py +++ b/conifer/syrup/views/items.py @@ -283,7 +283,7 @@ def item_download(request, course_id, item_id, filename): # 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] -- 2.11.0