60c5496c1df3ae97de10b263e01b7698afbfc743
tdreszer
  Fri Oct 28 14:28:10 2011 -0700
Eliminated a couple more vars from cart and FINALY got rid of funky comp.view.vis cart name.  All vis is not standardized to trackName since view is a track.
diff --git src/hg/js/utils.js src/hg/js/utils.js
index 0001e66..2cfe963 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -1140,34 +1140,36 @@
     } else
         disableNamedVariable(theForm,trackName_Sel);
     return true;
 }
 
 //////////// Drag and Drop ////////////
 function tableDragAndDropRegister(thisTable)
 {// Initialize a table with tableWithDragAndDrop
     if ($(thisTable).hasClass("tableWithDragAndDrop") == false)
         return;
 
     $(thisTable).tableDnD({
         onDragClass: "trDrag",
         dragHandle: "dragHandle",
         onDrop: function(table, row, dragStartIndex) {
+                if (row.rowIndex != dragStartIndex) {
                 if(tableSetPositions) {
                     tableSetPositions(table);
                 }
             }
+            }
     });
     $(thisTable).find("td.dragHandle").hover(
         function(){ $(this).closest('tr').addClass('trDrag'); },
         function(){ $(this).closest('tr').removeClass('trDrag'); }
     );
 }
 
 //////////// Sorting ////////////
 // Sorting a table by columns relies upon the sortColumns structure
 
 // The sortColumns structure looks like:
 //{
 //    char *  tags[];     // a list of field names in sort order (e.g. 'cell', 'shortLabel')
 //    boolean reverse[];  // the sort direction for each sort field
 //    int     cellIxs[];  // The indexes of the columns in the table to be sorted
@@ -1414,32 +1416,35 @@
                         if (cIx < 5)  // Show numbering and direction only for the first 5
                             content += (cIx+1);
                         else
                             content = "";
                     }
 
                     if (sup)
                         sup.innerHTML = content;
                     else
                         $(th).append("<sup>"+content+"</sup>");
                 }
             });
         }
         // There may be a hidden input that gets updated to the cart
         var inp = $(tr).find('input.sortOrder')[0];
-        if (inp)
+        if (inp) {
             $(inp).val(sortOrderFromColumns(sortColumns));
+            if (!addSuperscript && typeof(subCfg) !== "undefined")
+                subCfg.markChange(null,inp);     // use instead of change() because type=hidden!
+        }
     }
 }
 
 function sortOrderFromTr(tr)
 {// Looks up the sortOrder input value from a *.sortable header row of a sortable table
     var inp = $(tr).find('input.sortOrder')[0];
     if (inp)
         return $(inp).val();
     else {
         // create something like "cellType=+ rep=+ protocol=+ treatment=+ factor=+ view=+"
         var fields = new Array();
         var cells = $(tr).find('th.sortable');
         $(cells).each(function (i) {
             var classList = $( this ).attr("class").split(" ");
             if (classList.length < 2) // assertable