// when the user presses the mouse, add an Endpoint, if we are enabled.
var mouseDownListener = function (e) {
// on right mouse button, abort.
if (e.which === 3 || e.button === 2) {
return;
}
elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.
// TODO store def on element.
var def = this.sourceEndpointDefinitions[elid][type];
// if disabled, return.
if (!def.enabled) {
return;
}
...
}
官网文档好像没有说如何 销毁这个实例化对象 直接将变量重置为
null
后重新初始化 然后点击节点 会报以下错误对应源码为
mouseDownListener
函数中6335行代码var def = this.sourceEndpointDefinitions[elid][type];
报错