(button, items, title)
| 63 | } |
| 64 | |
| 65 | function showNavigationMenu(button, items, title) { |
| 66 | closeMenu(); |
| 67 | |
| 68 | const menu = createElement('div', 'callee-menu'); |
| 69 | menu.appendChild(createElement('div', 'callee-menu-header', title)); |
| 70 | |
| 71 | items.forEach(linkData => { |
| 72 | const item = createElement('div', 'callee-menu-item'); |
| 73 | |
| 74 | const funcDiv = createElement('div', 'callee-menu-func'); |
| 75 | funcDiv.textContent = linkData.func; |
| 76 | |
| 77 | if (linkData.count !== undefined && linkData.count > 0) { |
| 78 | const countBadge = createElement('span', 'count-badge'); |
| 79 | countBadge.textContent = linkData.count.toLocaleString(); |
| 80 | countBadge.title = `${linkData.count.toLocaleString()} samples`; |
| 81 | funcDiv.appendChild(document.createTextNode(' ')); |
| 82 | funcDiv.appendChild(countBadge); |
| 83 | } |
| 84 | |
| 85 | item.appendChild(funcDiv); |
| 86 | item.appendChild(createElement('div', 'callee-menu-file', linkData.file)); |
| 87 | item.addEventListener('click', () => window.location.href = linkData.link); |
| 88 | menu.appendChild(item); |
| 89 | }); |
| 90 | |
| 91 | const pos = calculateMenuPosition(button.getBoundingClientRect(), 350, 300); |
| 92 | menu.style.left = `${pos.left}px`; |
| 93 | menu.style.top = `${pos.top}px`; |
| 94 | |
| 95 | document.body.appendChild(menu); |
| 96 | currentMenu = menu; |
| 97 | } |
| 98 | |
| 99 | // ============================================================================ |
| 100 | // Navigation |
no test coverage detected
searching dependent graphs…