bffbb000a3df4b88a8117ea5f852ab3abeea6e17
angie
  Mon Sep 24 14:42:01 2018 -0700
Added a new mode to hgSuggest: altOrPatch, to match alt haplo or fix patch sequence names.  Use it in hgTracks' multi-region dialog.  Make the dialog inputs activate their respective radio buttons.  refs #18854

diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 34d27b4..968bf01 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -3562,30 +3562,43 @@
                         else
                             ddcl.setup(this, 'noneIsAll');
                     }
                 );
             },
 
             close: function() {
                 popUpHgt.cleanup();
             }
         });
         
     
         $('#hgTracksDialog').dialog('option' , 'title' , popUpHgt.title);
         $('#hgTracksDialog').dialog('open');
 
+        // Initialize autocomplete for alt/fix sequence names
+        autocompleteCat.init($('#singleAltHaploId'),
+                             { baseUrl: 'hgSuggest?db=' + getDb() + '&type=altOrPatch&prefix=',
+                               enterSelectsIdentical: true });
+        // Make option inputs select their associated radio buttons
+        $('input[name="emPadding"]').keyup(function() {
+            $('#virtModeType[value="exonMostly"]').attr('checked', true); });
+        $('input[name="gmPadding"]').keyup(function() {
+            $('#virtModeType[value="geneMostly"]').attr('checked', true); });
+        $('#multiRegionsBedInput').keyup(function() {
+            $('#virtModeType[value="customUrl"]').attr('checked', true); });
+        $('#singleAltHaploId').keyup(function() {
+            $('#virtModeType[value="singleAltHaplo"]').attr('checked', true); });
     }
 };
 
 // A function to show the keyboard help dialog box, bound to ? and called from the menu bar
 function showHotkeyHelp() {
     $("#hotkeyHelp").dialog({width:'600'});
 }
 
 // A function to add an entry for the keyboard help dialog box to the menubar 
 // and add text that indicates the shortcuts to many static menubar items as suggested by good old IBM CUA/SAA
 function addKeyboardHelpEntries() {
     var html = '<li><a id="keybShorts" title="List all possible keyboard shortcuts" href="#">Keyboard Shortcuts</a><span class="shortcut">?</span></li>';
     $('#help .last').before(html);
     $("#keybShorts").click( function(){showHotkeyHelp();} );