How to differentiate element's $type between "bpmn:EndEvent" and it's label when custom contextPad

I want to set different contextPad for each elements. My question is that “bpmn:EndEvent” element’s $type is similar to it’s label’s $type. so i can’t differentiate them.
This is my code and some console
code
"EndEvent" console
endevent
label console
label

is there any way to disabled label’s contextPad

So if I understand you right, you want to detect labels? You could do this via following helper function

function isLabel(element) {
  return !!element.labelTarget;
}
2 Likes