Port type

This commit is contained in:
BoykoAlex
2019-11-04 11:32:59 -05:00
parent fc0fc4e3c4
commit d2efa2251b

View File

@@ -123,6 +123,7 @@ joint.shapes.flo.Node = joint.shapes.basic.Generic.extend({
'stroke-width': 1
},
'.input-port': {
type: 'input',
port: 'input',
height: 8, width: 8,
magnet: true,
@@ -132,6 +133,7 @@ joint.shapes.flo.Node = joint.shapes.basic.Generic.extend({
'stroke-width': 1
},
'.output-port': {
type: 'output',
port: 'output',
height: 8, width: 8,
magnet: true,
@@ -250,7 +252,7 @@ joint.shapes.flo.ElementView = joint.dia.ElementView.extend({
linkView.notify('link:pointerdown', evt, x, y);
/*** START MAIN DIFF ***/
const sourceOrTarget = $(magnet).attr('port') === 'input' ? 'source' : 'target';
const sourceOrTarget = $(magnet).attr('type') === 'input' ? 'source' : 'target';
linkView.eventData(evt, linkView.startArrowheadMove(sourceOrTarget, { whenNotAllowed: 'remove' }));
/*** END MAIN DIFF ***/