visjs-network
Advanced tools
Comparing version 4.23.1 to 4.24.0
@@ -1145,2 +1145,29 @@ let util = require('../../util') | ||
let pointer = this.body.functions.getPointer(event.center) | ||
var pointerObj = this.selectionHandler._pointerToPositionObject(pointer) | ||
// remember the edge id | ||
var connectFromId = undefined | ||
if (this.temporaryIds.edges[0] !== undefined) { | ||
connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId | ||
} | ||
// get the overlapping node but NOT the temporary node; | ||
var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith( | ||
pointerObj | ||
) | ||
var node = undefined | ||
for (var i = overlappingNodeIds.length - 1; i >= 0; i--) { | ||
// if the node id is NOT a temporary node, accept the node. | ||
if (this.temporaryIds.nodes.indexOf(overlappingNodeIds[i]) === -1) { | ||
node = this.body.nodes[overlappingNodeIds[i]] | ||
break | ||
} | ||
} | ||
event.controlEdge = { from: connectFromId, to: node ? node.id : undefined } | ||
this.selectionHandler._generateClickEvent( | ||
'controlNodeDragging', | ||
event, | ||
pointer | ||
) | ||
if (this.temporaryIds.nodes[0] !== undefined) { | ||
@@ -1209,2 +1236,9 @@ let targetNode = this.body.nodes[this.temporaryIds.nodes[0]] // there is only one temp node in the add edge mode. | ||
event.controlEdge = { from: connectFromId, to: node ? node.id : undefined } | ||
this.selectionHandler._generateClickEvent( | ||
'controlNodeDragEnd', | ||
event, | ||
pointer | ||
) | ||
// No need to do _generateclickevent('dragEnd') here, the regular dragEnd event fires. | ||
@@ -1211,0 +1245,0 @@ this.body.emitter.emit('_redraw') |
@@ -156,2 +156,6 @@ var Node = require('./components/Node').default | ||
if (event.controlEdge !== undefined) { | ||
properties.controlEdge = event.controlEdge | ||
} | ||
this.body.emitter.emit(eventType, properties) | ||
@@ -158,0 +162,0 @@ } |
{ | ||
"name": "visjs-network", | ||
"version": "4.23.1", | ||
"version": "4.24.0", | ||
"description": "A dynamic, browser-based network visualization library.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://visjs.org/", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 2 instances in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 2 instances in 1 package
12208999
96743