2062c2da5318c4ccec237e9e099c97e447a52f06 chmalee Thu Sep 25 17:08:39 2025 -0700 Don't do hubSpace init if we are looking at a different hgHubConnect tab, call hubSpace init when we switch to that tab, refs Jairo email diff --git src/hg/js/hgHubConnect.js src/hg/js/hgHubConnect.js index d3373badf65..9b1e52b88c3 100644 --- src/hg/js/hgHubConnect.js +++ src/hg/js/hgHubConnect.js @@ -79,30 +79,33 @@ var tabName = window.location.hash; if (tabName==="publicHubs") $("#tabs").tabs("option", "active", 0); if (tabName==="#conn" || tabName === "unlistedHubs") $("#tabs").tabs("option", "active", 1); if (tabName==="#dev" || tabName === "hubDeveloper") $("#tabs").tabs("option", "active", 2); if (tabName==="#hubUpload") $("#tabs").tabs("option", "active", 3); $("#tabs").tabs().on("tabsactivate", function(event, ui) { const newHash = ui.newTab.find("a").attr("href"); if (newHash) { history.replaceState(null, null, newHash); } + if (newHash === "#hubUpload") { + hubCreate.init(); + } }); }); // creates keyup event; listening for return key press $(document).ready(function() { $('#loadSampleHub').bind('click', function(e) { $('#validateHubUrl').val("https://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/hub.txt"); }); $('#hubUrl').bind('keypress', function(e) { // binds listener to url field if (e.which === 13) { // listens for return key e.preventDefault(); // prevents return from also submitting whole form if (validateUrl($('#hubUrl').val())) $('input[name="hubAddButton"]').focus().click(); // clicks AddHub button }