MCPcopy Create free account
hub / github.com/google/pprof / handleTopClick

Function handleTopClick

internal/driver/html/common.js:628–653  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

626 }
627
628 function handleTopClick(e) {
629 // Walk back until we find TR and then get the Name column (index 5)
630 let elem = e.target;
631 while (elem != null && elem.nodeName != 'TR') {
632 elem = elem.parentElement;
633 }
634 if (elem == null || elem.children.length < 6) return;
635
636 e.preventDefault();
637 const tr = elem;
638 const td = elem.children[5];
639 if (td.nodeName != 'TD') return;
640 const name = td.innerText;
641 const index = nodes.indexOf(name);
642 if (index < 0) return;
643
644 // Disable regexp mode.
645 regexpActive = false;
646
647 if (selected.has(index)) {
648 unselect(index, elem);
649 } else {
650 select(index, elem);
651 }
652 updateButtons();
653 }
654
655 function updateButtons() {
656 const enable = (search.value != '' || getSelection().size != 0);

Callers

nothing calls this directly

Calls 3

unselectFunction · 0.85
selectFunction · 0.85
updateButtonsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…