Browse Source

Merge remote-tracking branch 'origin/develop' into develop

Conflicts:
	dist/vis.js
kamadaKawai
jos 9 years ago
parent
commit
acd52e1ee3
5 changed files with 14 additions and 25 deletions
  1. +0
    -1
      lib/network/modules/Clustering.js
  2. +14
    -8
      lib/network/modules/InteractionHandler.js
  3. +0
    -1
      lib/network/modules/NodesHandler.js
  4. +0
    -12
      lib/network/modules/components/Node.js
  5. +0
    -3
      lib/network/modules/components/nodes/util/NodeBase.js

+ 0
- 1
lib/network/modules/Clustering.js View File

@ -600,7 +600,6 @@ class ClusterEngine {
}
// remove clusterNode
this.body.nodes[clusterNodeId].cleanup();
delete this.body.nodes[clusterNodeId];
if (refreshData === true) {

+ 14
- 8
lib/network/modules/InteractionHandler.js View File

@ -190,10 +190,12 @@ class InteractionHandler {
let currentSelection = this.selectionHandler.getSelection();
let {nodesChanges, edgesChanges} = this._determineIfDifferent(previousSelection, currentSelection);
let nodeSelected = false;
if (selectedNodesCount - previouslySelectedNodeCount > 0) { // node was selected
this.selectionHandler._generateClickEvent('selectNode', event, pointer);
selected = true;
nodeSelected = true;
}
else if (selectedNodesCount - previouslySelectedNodeCount < 0) { // node was deselected
this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
@ -202,22 +204,26 @@ class InteractionHandler {
else if (selectedNodesCount === previouslySelectedNodeCount && nodesChanges === true) {
this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
this.selectionHandler._generateClickEvent('selectNode', event, pointer);
nodeSelected = true;
selected = true;
}
if (selectedEdgesCount - previouslySelectedEdgeCount < 0 || (selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true)) { // edge was deselected
this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
selected = true;
// handle the selected edges
if (selectedEdgesCount - previouslySelectedEdgeCount > 0 && nodeSelected === false) { // edge was selected
this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
selected = true;
}
// Check if the user clicked on an edge
let selectedNode = this.selectionHandler._getSelectedNode();
let selectedEdge = this.selectionHandler._getSelectedEdge();
if (selectedNode === undefined && selectedEdge !== undefined) {
else if (selectedEdgesCount - previouslySelectedEdgeCount < 0) { // edge was deselected
this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
selected = true;
}
else if (selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true) {
this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
selected = true;
}
// fire the select event if anything has been selected or deselected
if (selected === true) { // select or unselect
this.selectionHandler._generateClickEvent('select', event, pointer);
}

+ 0
- 1
lib/network/modules/NodesHandler.js View File

@ -275,7 +275,6 @@ class NodesHandler {
for (let i = 0; i < ids.length; i++) {
let id = ids[i];
nodes[id].cleanup();
delete nodes[id];
}

+ 0
- 12
lib/network/modules/components/Node.js View File

@ -227,10 +227,6 @@ class Node {
this.shape.setOptions(this.options);
}
else {
// clean up the shape if it is already made so the new shape can start clean.
if (this.shape) {
this.shape.cleanup();
}
// choose draw method depending on the shape
switch (this.options.shape) {
case 'box':
@ -438,14 +434,6 @@ class Node {
this.shape.boundingBox.bottom > obj.top
);
}
/**
* clean all required things on delete.
* @returns {*}
*/
cleanup() {
return this.shape.cleanup();
}
}
export default Node;

+ 0
- 3
lib/network/modules/components/nodes/util/NodeBase.js View File

@ -67,9 +67,6 @@ class NodeBase {
}
}
}
// possible cleanup for use in shapes
cleanup() {}
}
export default NodeBase;

Loading…
Cancel
Save