(e, box)
| 88 | |
| 89 | // Display action menu (triggered by right-click on a frame) |
| 90 | function showActionMenu(e, box) { |
| 91 | if (box.src == 0) return; // No action menu for root |
| 92 | e.preventDefault(); // Disable browser context menu |
| 93 | const src = stacks.Sources[box.src]; |
| 94 | actionTitle.innerText = src.Display[src.Display.length-1]; |
| 95 | const menu = actions; |
| 96 | menu.style.display = 'block'; |
| 97 | // Compute position so menu stays visible and near the mouse. |
| 98 | const x = Math.min(e.clientX - 10, document.body.clientWidth - menu.clientWidth); |
| 99 | const y = Math.min(e.clientY - 10, document.body.clientHeight - menu.clientHeight); |
| 100 | menu.style.left = x + 'px'; |
| 101 | menu.style.top = y + 'px'; |
| 102 | // Set menu links to operate on clicked box. |
| 103 | setHrefParam('action-source', 'f', box.src); |
| 104 | setHrefParam('action-source-tab', 'f', box.src); |
| 105 | setHrefParam('action-focus', 'f', box.src); |
| 106 | setHrefParam('action-ignore', 'i', box.src); |
| 107 | setHrefParam('action-hide', 'h', box.src); |
| 108 | setHrefParam('action-showfrom', 'sf', box.src); |
| 109 | toggleClass(box.src, 'hilite2', true); |
| 110 | actionTarget = box; |
| 111 | actionMenuOn = true; |
| 112 | } |
| 113 | |
| 114 | function hideActionMenu() { |
| 115 | actions.style.display = 'none'; |
no test coverage detected
searching dependent graphs…