1a2aef3c877e9a8e365da31b63acde9032bd01bc
chmalee
  Wed Dec 3 12:50:09 2025 -0800
Make gene alleles section of hgGene show up when doing hgGene in a pop up, refs #36770

diff --git src/hg/js/alleles.js src/hg/js/alleles.js
index 19588ca31d4..7f71f8924af 100644
--- src/hg/js/alleles.js
+++ src/hg/js/alleles.js
@@ -1,19 +1,20 @@
 // JavaScript Especially for the Gene Haplotype Alleles section of hgGene CGI
 
 // Don't complain about line break before '||' etc:
 /* jshint -W014 */
+/* jshint esnext: true */
 
 // Alleles supports gene haplotype alleles section
 var alleles = (function()
 {
 
     var sectionName         = "haplotypes";  // This define is used throughout
     var seqCharsPerPos      = 1;  // These globals should only need to be calculated once
     var seqPxPerPos         = 7;
     var ajaxUpdates         = 0;
 
     // persistence between ajax calls
     var persistRareHapsShown = false; 
     var persistScoresShown   = false; 
     var persistSortReverse   = false;
     var persistSortColId     = '';
@@ -56,44 +57,43 @@
                 ajaxUpdates++;
                 $(geneAlleles[0]).html( cleanHtml );
                 hiliteRemove();
 
 		appendNonceJsToPage(nonceJs);
 
                 alleles.initialize();  // Must have prefix, since ajax call
             }
         }
     }
     
     function ajaxRequest(data)
     { // Request an ajax update of this section
     
         // Use current url but make sure it is relative
-        var thisUrl = window.location.href;
-        var ix = thisUrl.indexOf("cgi-bin");
-        if (ix > 0)
-            thisUrl = "../" + thisUrl.substring(ix);
+        var thisUrl = new URL(window.location.href);
+        let queryArgs = varHashToQueryString(window.hgcOrHgGeneArgs);
+        thisUrl = "../cgi-bin/hgGene?" + queryArgs;
         
         $.ajax({
                 type: "GET",
                 url: thisUrl,
                 data: "ajax=1&" + data + "&ajaxSection=" + sectionName,
                 dataType: "html",
                 trueSuccess: update,
                 success: catchErrorOrDispatch,
                 error: errorHandler,
-                //async: false,
+                async: false,
                 //cmd: cmd,
                 loadingId: showLoadingImage(sectionName),
                 cache: false
             });
     }
     
     function afterSort(obj)
     {   // The sort table is controlled by utls.js, but this is some allele specific stuff
     
         var thisId = $(obj).attr('id');
         if (persistSortColId !== thisId)
             persistSortColId  = thisId;
         else
             persistSortReverse = ( !persistSortReverse );