37b585ad1c4f5bfa5598fa987485d56120ef6d9e
galt
  Wed Sep 14 14:18:05 2016 -0700
Fixes #18702. Uses async=false flag with cart.setVarsObj to prevent network error in Firefox and Safari while saving the state of the hidden highlight popup. It needs to wait for the ajax update to finish before submitting the form.

diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 275e2f0..0e726aa 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -945,31 +945,31 @@
                 $(this).attr('class', 'normalText');
             
             cart.addVarsToQueue([track], [$(this).val()]);
             imageV2.markAsDirtyPage();
             return false;
         });
         // Now we can rid the submt of the burden of all those vis boxes
         var form = $('form#TrackForm');
         $(form).submit(function () {
             $('select.normalText,select.hiddenText').attr('disabled',true);
         });
         $(form).attr('method','get');
     },
 
     restoreFromBackButton: function()
-    // Re-enabling vis dropdowns is necessarty because intiForAjax() disables them on submit.
+    // Re-enabling vis dropdowns is necessary because initForAjax() disables them on submit.
     {
         $('select.normalText,select.hiddenText').attr('disabled',false);
     }
 };
 
   ////////////////////////////////////////////////////////////
  // dragSelect is also known as dragZoom or shift-dragZoom //
 ////////////////////////////////////////////////////////////
 var dragSelect = {
 
     areaSelector:    null, // formerly "imgAreaSelect". jQuery element used for imgAreaSelect
     originalCursor:  null,
     startTime:       null,
 
     selectStart: function (img, selection)
@@ -1100,31 +1100,31 @@
                         // Zoom to selection
                         $(this).dialog("option", "revertToOriginalPos", false);
                         if ($("#disableDragHighlight").attr('checked'))
                             hgTracks.enableHighlightingDialog = false;
                         if (imageV2.inPlaceUpdate) {
 			    if (hgTracks.virtualSingleChrom && (newPosition.search("virt:")===0)) {
 				newPosition = genomePos.disguisePosition(newPosition); // DISGUISE
 			    }
                             var params = "position=" + newPosition;
                             if (!hgTracks.enableHighlightingDialog)
                                 params += "&enableHighlightingDialog=0";
                             imageV2.navigateInPlace(params, null, true);
                         } else {
                             $('body').css('cursor', 'wait');
                             if (!hgTracks.enableHighlightingDialog)
-                                cart.setVarsObj({'enableHighlightingDialog': 0 });
+                                cart.setVarsObj({'enableHighlightingDialog': 0 },null,false); // async=false
                             document.TrackHeaderForm.submit();
                         }
                         $(this).dialog("close");
                     },
                     "Highlight": function() {
                         // Highlight selection
                         $(imageV2.imgTbl).imgAreaSelect({hide:true});
                         if ($("#disableDragHighlight").attr('checked'))
                             hgTracks.enableHighlightingDialog = false;
                         dragSelect.highlightThisRegion(newPosition);
                         $(this).dialog("close");
                     },
                     "Cancel": function() {
                         $(this).dialog("close");
                     }