I am trying to get a function call on click on tool-options so that I can change the label name of link. I am able to get a function call using cell:pointerdown event but that is giving me the id of whole link, and that event is getting called on click at any position of the link. So to be specific I want to get call on click on tool-options image (settings tab).
The code which I am trying is:
paper.on('cell:pointerdown',
function(cellView, evt, x, y) {
if (cellView.model.isLink()) {
var links = graph.getLinks();
console.log(cellView.model.id);
for (var i = 0; i < links.length; i++){
console.log(links[i].id);
links[i].label(0, { attrs: { text: { text: 'my label' } } });
}
}
This is working fine but I want the same event on click on tool-options image on link and not at anywhere on the link.