src/hg/js/hgTracks.js 1.68

1.68 2010/05/14 17:33:19 tdreszer
Got rid of imgOrd hidden inputs. This is set by ajax now.
Index: src/hg/js/hgTracks.js
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/js/hgTracks.js,v
retrieving revision 1.67
retrieving revision 1.68
diff -b -B -U 4 -r1.67 -r1.68
--- src/hg/js/hgTracks.js	6 May 2010 18:53:34 -0000	1.67
+++ src/hg/js/hgTracks.js	14 May 2010 17:33:19 -0000	1.68
@@ -709,15 +709,21 @@
 // Drag Reorder Code
 function imgTblSetOrder(table)
 {
 // Sets the 'order' value for the image table after a drag reorder
-    $("input[name$='_imgOrd']").each(function (i) {
-        var tr = $(this).parents('tr');
-        if($(this).val() != $(tr).attr('rowIndex')) {
-            //warn('Reordered '+$(this).val() + " to "+$(tr).attr('rowIndex'));
-            $(this).val($(tr).attr('rowIndex'));
+    var names = [];
+    var values = [];
+    $("tr.imgOrd").each(function (i) {
+        if ($(this).attr('abbr') != $(this).attr('rowIndex').toString()) {
+            $(this).attr('abbr',$(this).attr('rowIndex').toString());
+            var name = this.id.substring('tr_'.length) + '_imgOrd';
+            names.push(name);
+            values.push($(this).attr('abbr'));
         }
     });
+    if(names.length > 0) {
+        setCartVars(names,values);
+    }
 }
 
 function imgTblZipButtons(table)
 {