Skip to content

Commit

Permalink
dismiss saveImage dropdown on browser resize
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Nov 20, 2023
1 parent d70f3e7 commit d8b612d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
17 changes: 11 additions & 6 deletions js/ui/navbarButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ class NavbarButton {
this.setState(initialButtonState)

browser.on('navbar-resize', navbarButtonCSSClass => {
const key = 'igv-navbar-icon-button' === navbarButtonCSSClass ? 'image' : 'text'
if (key !== this.responsiveKey) {
this.responsiveKey = key
this.configureButton(title)
this.setState(undefined)
}
this.navbarResizeHandler(navbarButtonCSSClass)
})

}

navbarResizeHandler(navbarButtonCSSClass) {
const key = 'igv-navbar-icon-button' === navbarButtonCSSClass ? 'image' : 'text'
if (key !== this.responsiveKey) {
this.responsiveKey = key
this.configureButton(this.title)
this.setState(undefined)
}
}

configureButton(title) {

this.groupElement = undefined
Expand Down
5 changes: 5 additions & 0 deletions js/ui/saveImageControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ class SaveImageControl extends NavbarButton {

}

navbarResizeHandler(navbarButtonCSSClass) {
this.dropdown.dismiss()
super.navbarResizeHandler(navbarButtonCSSClass)
}

}

export default SaveImageControl

0 comments on commit d8b612d

Please sign in to comment.