Skip to content

Commit

Permalink
Save Image dropdown implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Nov 20, 2023
1 parent 968a553 commit 1531407
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions js/ui/saveImageControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SaveImageControl extends NavbarButton {
this.setState(false)
})

this.dropdown = new Dropdown(this.button.parentNode, { top:20, left:64 })
this.dropdown = new Dropdown(this.button.parentNode, { top:24, left:-33 })

const items =
[
Expand All @@ -73,15 +73,20 @@ class SaveImageControl extends NavbarButton {

this.button.addEventListener('click', e => {

let takeAction
if (e.target === this.button) {
this.dropdown.present(e)
takeAction = true
} else if (e.target.closest('svg')) {
const parentDiv = e.target.closest('div')
if (parentDiv === this.button) {
this.dropdown.present(e)
takeAction = true
}
}

if (true === takeAction) {
'none' === this.dropdown.popover.style.display ? this.dropdown.present(e) : this.dropdown.dismiss()
}

})

this.setVisibility(browser.config.showSVGButton)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"circular-view": "github:igvteam/circular-view#v0.2.4",
"eslint": "^6.4.0",
"hdf5-indexed-reader": "github:jrobinso/hdf5-indexed-reader#v0.5.5",
"igv-ui": "github:igvteam/igv-ui#v1.5.3",
"igv-ui": "github:igvteam/igv-ui#dat_dropdown",
"igv-utils": "github:igvteam/igv-utils#v1.4.8",
"mocha": "^10.2.0",
"rollup": "^2.66.0",
Expand Down

0 comments on commit 1531407

Please sign in to comment.