Skip to content

Commit

Permalink
chr pulldown bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Oct 24, 2024
1 parent 1ccef19 commit ce4bada
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 2 additions & 4 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,13 +1453,11 @@ class Browser {
referenceFrame.end = referenceFrame.start + referenceFrame.bpPerPixel * width
}

if (this.chromosomeSelectWidget) {
this.chromosomeSelectWidget.select.value = referenceFrameList.length === 1 ? this.referenceFrameList[0].chr : ''
}
const chrName = referenceFrameList.length === 1 ? this.referenceFrameList[0].chr : ''

const loc = this.referenceFrameList.map(rf => rf.getLocusString()).join(' ')

this.navbar.updateLocus(loc)
this.navbar.updateLocus(loc, chrName)

this.fireEvent('locuschange', [this.referenceFrameList])
}
Expand Down
9 changes: 7 additions & 2 deletions js/responsiveNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,13 @@ class ResponsiveNavbar {
}
}

updateLocus(loc) {
this.$searchInput.val(loc)
updateLocus(loc, chrName) {
if(this.$searchInput) {
this.$searchInput.val(loc)
}
if (this.chromosomeSelectWidget) {
this.chromosomeSelectWidget.select.value = chrName
}
}

currentNavbarButtonClass() {
Expand Down

0 comments on commit ce4bada

Please sign in to comment.