From e183bfe8618ab27e71eb0d92876eba02d8274d55 Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:20:04 -0800 Subject: [PATCH] Bug fix -- genome list divider was searched by class, rather than ID --- js/genomeWidgets.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/genomeWidgets.js b/js/genomeWidgets.js index b3fb93c..38d2338 100644 --- a/js/genomeWidgets.js +++ b/js/genomeWidgets.js @@ -33,7 +33,7 @@ import { } from '../node_modules/igv-widgets/dist/igv-widgets.js' import Globals from "./globals.js" -const MAX_CUSTOM_GENOMES = 5 +const MAX_CUSTOM_GENOMES = 10 let predefinedGenomeIds let predefinedGenomes @@ -121,8 +121,12 @@ function getCustomGenomes() { function updateGenomeList() { const $dropdown_menu = $('#igv-app-genome-dropdown-menu') - // discard all buttons preceeding the divider div - let $divider = $dropdown_menu.find('.dropdown-divider') + + // NOTE: MUST USE ID HERE, THERE CAN BE MULTIPLE DIVIDERS. JQUERY DOES WEIRD THINGS IN THE CODE THAT FOLLOWS IF $divider IS A COLLECTION + const $divider = $dropdown_menu.find('#igv-app-genome-dropdown-divider') + + // discard all buttons following the divider div + $divider.nextAll().off() $divider.nextAll().remove() const addEntryFor = (genomeJson) => { @@ -155,7 +159,7 @@ function updateGenomeList() { const customGenomes = getCustomGenomes() if (customGenomes && customGenomes.length > 0) { $('
').insertAfter($divider) - for (let genomeJson of customGenomes) { + for (let genomeJson of customGenomes.reverse()) { addEntryFor(genomeJson) }