From ffa3b374c9db1f238e23d6ac2bf7e5fb1c585ecf Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:30:53 -0700 Subject: [PATCH] Reorder session menu --- index.html | 4 +--- js/app.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index df99c2e..e27dbe4 100644 --- a/index.html +++ b/index.html @@ -275,13 +275,11 @@ Load URL ... - - - diff --git a/js/app.js b/js/app.js index 7fc5236..747d6cf 100644 --- a/js/app.js +++ b/js/app.js @@ -303,7 +303,7 @@ async function initializationHelper(browser, container, options) { sessionSaver) if (options.sessionRegistryFile) { - await createSessionMenu('igv-session-list-divider', options.sessionRegistryFile, sessionLoader) + await createSessionMenu('save-session-button', options.sessionRegistryFile, sessionLoader) } else { document.querySelector('#igv-session-list-divider').style.display = 'none' } @@ -402,7 +402,9 @@ function createSampleInfoMenu(igvMain, { success: dbFiles => { - const configList = dbFiles.map(({link}) => { return {url: link} }) + const configList = dbFiles.map(({link}) => { + return {url: link} + }) sampleInfoFileLoadHandler(configList[0]) }, @@ -489,7 +491,7 @@ function createSampleInfoMenu(igvMain, Utils.configureModal(fileLoadWidget, urlModal, async fileLoadWidget => { const paths = fileLoadWidget.retrievePaths() - await sampleInfoFileLoadHandler({url:paths[0]}) + await sampleInfoFileLoadHandler({url: paths[0]}) return true }) @@ -564,8 +566,7 @@ async function createSessionMenu(sessionListDivider, sessionRegistryFile, sessio if (sessionJSON) { const sessions = sessionJSON['sessions'] - - let firstSection = true + for (let {name, url} of sessions.reverse()) { const referenceNode = document.getElementById(sessionListDivider) @@ -591,10 +592,7 @@ async function createSessionMenu(sessionListDivider, sessionRegistryFile, sessio const html = `` const el = fromHTML(html) referenceNode.after(el) - if (!firstSection) { - referenceNode.after(fromHTML('