73b05663e1f9a56f25cc58a8aab51ff8fa79152b max Thu Jun 16 08:18:44 2022 -0700 changes after code review, refs #29594 diff --git src/hg/js/hgHubConnect.js src/hg/js/hgHubConnect.js index f802688..39d5bb3 100644 --- src/hg/js/hgHubConnect.js +++ src/hg/js/hgHubConnect.js @@ -105,38 +105,38 @@ $('input[name="hubSearchButton"]').focus().click(); // clicks db filter button } }); $('.pasteIcon').bind('click', function(e) { // the genome=hg19-part is stored in the <A> element two elements before var link = e.target.parentElement.previousSibling.previousSibling; var href = link.href; var genomeArg = href.split("&")[1]; // the url is in the <input> element just before the SVG var copyText = e.target.parentElement.previousSibling; var myBaseUrl = copyText.baseURI.split('?')[0]; var hgTracksUrl = myBaseUrl.replace("hgHubConnect", "hgTracks"); var oldVal = copyText.value; copyText.value = hgTracksUrl+"?hubUrl="+copyText.value+"&"+genomeArg; + copyText.style.display = 'none'; copyText.type = 'text'; copyText.select(); copyText.setSelectionRange(0, 99999); /* For mobile devices */ document.execCommand('copy'); + copyText.type = 'hidden'; alert("Copied the URL " + copyText.value + " to the clipboard"); copyText.value = oldVal; - copyText.type = 'hidden'; - //navigator.clipboard.writeText(copyText.value); }); }); var hubSearchTree = (function() { var treeDiv; // Points to div we live in function hubSearchTreeContextMenuHandler (node, callback) { var nodeType = node.li_attr.nodetype; if (nodeType == 'track') { callback({ 'openConfig': { 'label' : 'Configure this track', 'action' : function () { window.open(node.li_attr.configlink, '_blank');