Skip to content

Commit

Permalink
Tweak hub example
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Dec 8, 2023
1 parent 3e357f9 commit 2bf4894
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions docs/web/TrackHubsDynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,21 @@ <h2>Hubs</h2>
])

const igvIsRunning = await igvRunning()

if (igvIsRunning) {
for (let key of hubs.keys()) {
const div = document.createElement("div")
div.innerText = key
div.dataset.hubUrl = hubs.get(key)
div.addEventListener("click", loadIGV)
div.style = "cursor:pointer;color:blue;text-decoration:underline;"

const li = document.createElement("li")
li.appendChild(div)

document.getElementById("hub_list").appendChild(li)
}
} else {
document.getElementById("hub_message").innerText = "You must start IGV 3.0 or later to enable links."

for (let key of hubs.keys()) {
const div = document.createElement("div")
div.innerText = key
div.dataset.hubUrl = hubs.get(key)
div.addEventListener("click", loadIGV)
div.style = "cursor:pointer;color:blue;text-decoration:underline;"

const li = document.createElement("li")
li.appendChild(div)

document.getElementById("hub_list").appendChild(li)
}


async function loadIGV(e) {
if (igvIsRunning) {
const url = `http://localhost:60151?hubURL=${e.currentTarget.dataset.hubUrl}`
Expand Down

0 comments on commit 2bf4894

Please sign in to comment.