|
|
@ -270,6 +270,7 @@ function Network (container, data, options) { |
|
|
|
this.startedStabilization = false; |
|
|
|
this.stabilized = false; |
|
|
|
this.stabilizationIterations = null; |
|
|
|
this.draggingNodes = false; |
|
|
|
|
|
|
|
// containers for nodes and edges
|
|
|
|
this.calculationNodes = {}; |
|
|
@ -858,8 +859,10 @@ Network.prototype._handleDragStart = function() { |
|
|
|
drag.selection = []; |
|
|
|
drag.translation = this._getTranslation(); |
|
|
|
drag.nodeId = null; |
|
|
|
this.draggingNodes = false; |
|
|
|
|
|
|
|
if (node != null && this.constants.dragNodes == true) { |
|
|
|
this.draggingNodes = true; |
|
|
|
drag.nodeId = node.id; |
|
|
|
// select the clicked node if not yet selected
|
|
|
|
if (!node.isSelected()) { |
|
|
@ -986,7 +989,13 @@ Network.prototype._handleDragEnd = function(event) { |
|
|
|
else { |
|
|
|
this._redraw(); |
|
|
|
} |
|
|
|
this.emit("dragEnd",{nodeIds:this.getSelection().nodes}); |
|
|
|
if (this.draggingNodes == false) { |
|
|
|
this.emit("dragEnd",{nodeIds:[]}); |
|
|
|
} |
|
|
|
else { |
|
|
|
this.emit("dragEnd",{nodeIds:this.getSelection().nodes}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
* handle tap/click event: select/unselect a node |
|
|
|