fixed 'Resequence' bug that was affecting Internet Explorer
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 1 May 2009 01:25:24 +0000 (01:25 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 1 May 2009 01:25:24 +0000 (01:25 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@426 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/static/menublocks.js
conifer/syrup/views/items.py

index 5071b7f..836da7f 100644 (file)
@@ -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);
index d984241..b0f9367 100644 (file)
@@ -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]