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