Skip to content

Commit

Permalink
Added ROI Set name to the ROI menu (#1875)
Browse files Browse the repository at this point in the history
* Added ROI Set name to the ROI menu

* Removed description label

* Refactored based on review

* Added max-width to popup
  • Loading branch information
milandomazet authored Aug 16, 2024
1 parent 5baebc5 commit b3460f0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion css/_igv-menu-popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $igv-menu-popup-grey: #7F7F7F;

//min-width: 132px;
width: max-content;

max-width: 400px;

//z-index: 4096;
z-index: 512;

Expand Down
1 change: 1 addition & 0 deletions css/igv.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/embedCss.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions js/roi/ROIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class ROIManager {
if (features) {

for (let feature of features) {

const regionKey = createRegionKey(chr, feature.start, feature.end)

const {
Expand Down Expand Up @@ -243,8 +242,7 @@ class ROIManager {
event.stopPropagation()

const {x, y} = DOMUtils.translateMouseCoordinates(event, columnContainer)
const isUserDefined = roiSet.isUserDefined
this.roiMenu.present(feature, isUserDefined, event, this, columnContainer, regionElement)
this.roiMenu.present(feature, roiSet, event, this, columnContainer, regionElement)
})


Expand Down
15 changes: 8 additions & 7 deletions js/roi/ROIMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ class ROIMenu {

}

async present(feature, isUserDefined, event, roiManager, columnContainer, regionElement) {
const menuItems = this.menuItems(feature, isUserDefined, event, roiManager, columnContainer, regionElement)
async present(feature, roiSet, event, roiManager, columnContainer, regionElement) {
const menuItems = this.menuItems(feature, roiSet, event, roiManager, columnContainer, regionElement)
this.browser.menuPopup.presentTrackContextMenu(event, menuItems)
}

menuItems(feature, isUserDefined, event, roiManager, columnContainer, regionElement) {
menuItems(feature, roiSet, event, roiManager, columnContainer, regionElement) {
const items = feature.name ? [`<b>${feature.name}</b><br/>`] : []
if ('name' in roiSet) items.push(`<b>ROI Set: ${roiSet.name}</b>`)
if (items.length > 0) items.push(`<hr/>`)

const items = [`<b>${feature.name || ''}</b>`,]

if (isUserDefined) {
if (roiSet.isUserDefined) {
items.push(
{
label: 'Set description ...',
Expand Down Expand Up @@ -103,7 +104,7 @@ class ROIMenu {
}


if (isUserDefined) {
if (roiSet.isUserDefined) {
items.push(
'<hr/>',
{
Expand Down

0 comments on commit b3460f0

Please sign in to comment.