Skip to content

Adding event handlers to buttons in foreignObject html #2681

Answered by kumilingus
cam-m asked this question in Q&A
Discussion options

You must be logged in to vote

There is no difference. The element view contains the element and the ports.
Each port has .joint-port class.

events: {
  'click .joint-port button': 'onPortButtonClick'
},
onPortButtonClick: function(evt) {
    evt.stopPropagation();
    const portId = this.findAttribute('port', evt.target);
    /* ... */
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cam-m
Comment options

@kumilingus
Comment options

Answer selected by cam-m
@cam-m
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants