Skip to content

Commit 7af5375

Browse files
committed
Add event to nodeHoverFn signature
1 parent 45283b8 commit 7af5375

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/js/kit/pathway-viewer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,10 @@ export async function drawPathway(
409409
pvjsContainer.insertAdjacentHTML('afterBegin', css);
410410

411411
pathwayContainer.querySelectorAll('g.GeneProduct').forEach(g => {
412-
const geneName = g.getAttribute('name');
413412
let tooltipContent = geneName;
414413
g.addEventListener('mouseover', (event) => {
415414
if (nodeHoverFn) {
416-
tooltipContent = nodeHoverFn(geneName);
415+
tooltipContent = nodeHoverFn(event, geneName);
417416
g.setAttribute('data-tippy-content', tooltipContent);
418417
tippy('g.GeneProduct[data-tippy-content]', tippyConfig);
419418
}

src/js/kit/related-genes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ function addPathwayListeners(ideo) {
16571657
// const pathwayName = target.getAttribute('data-pathway-name');
16581658
// const pathway = {id: pathwayId, name: pathwayName};
16591659
// plotPathwayGenes(searchedGene, pathway, ideo);
1660-
function nodeHoverFn(geneName) {
1660+
function nodeHoverFn(event, geneName) {
16611661
console.log('in nodeHoverFn')
16621662
return '<div>ok ' + geneName + '</div><div>1234</div>';
16631663
}

0 commit comments

Comments
 (0)