js-sequence-diagrams icon indicating copy to clipboard operation
js-sequence-diagrams copied to clipboard

support clicking

Open aiai5251 opened this issue 8 years ago • 1 comments

How can I support clicking every text tab?

aiai5251 avatar Sep 14 '17 09:09 aiai5251

I needed to support clicking on the "participant" (nodes) and managed to extract it by doing the following:

// Getting all the available "participants" - could alternatively adjust to select notes, signals etc.  
var actors = document.getElementsByClassName('actor');

// Making the first participant have an onClick event, could alternatively for loop
actors[0].style.cursor = 'pointer';
actors[0].onclick = () => {
 console.log(actors[0].textContent);
}

Hope this helps!

Bilaltariq98 avatar Jun 06 '18 16:06 Bilaltariq98