Browse Source

added getDataSet to network manipulation edge add and edit functions to match existing remove and node equivalents

flowchartTest
Eric VanDever 9 years ago
parent
commit
dc77069284
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      lib/network/modules/ManipulationSystem.js

+ 4
- 4
lib/network/modules/ManipulationSystem.js View File

@ -1085,7 +1085,7 @@ class ManipulationSystem {
if (this.options.addEdge.length === 2) { if (this.options.addEdge.length === 2) {
this.options.addEdge(defaultData, (finalizedData) => { this.options.addEdge(defaultData, (finalizedData) => {
if (finalizedData !== null && finalizedData !== undefined && this.inMode === 'addEdge') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback if (finalizedData !== null && finalizedData !== undefined && this.inMode === 'addEdge') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback
this.body.data.edges.add(finalizedData);
this.body.data.edges.getDataSet().add(finalizedData);
this.selectionHandler.unselectAll(); this.selectionHandler.unselectAll();
this.showManipulatorToolbar(); this.showManipulatorToolbar();
} }
@ -1096,7 +1096,7 @@ class ManipulationSystem {
} }
} }
else { else {
this.body.data.edges.add(defaultData);
this.body.data.edges.getDataSet().add(defaultData);
this.selectionHandler.unselectAll(); this.selectionHandler.unselectAll();
this.showManipulatorToolbar(); this.showManipulatorToolbar();
} }
@ -1117,7 +1117,7 @@ class ManipulationSystem {
this.body.emitter.emit('_redraw'); this.body.emitter.emit('_redraw');
} }
else { else {
this.body.data.edges.update(finalizedData);
this.body.data.edges.getDataSet().update(finalizedData);
this.selectionHandler.unselectAll(); this.selectionHandler.unselectAll();
this.showManipulatorToolbar(); this.showManipulatorToolbar();
} }
@ -1128,7 +1128,7 @@ class ManipulationSystem {
} }
} }
else { else {
this.body.data.edges.update(defaultData);
this.body.data.edges.getDataSet().update(defaultData);
this.selectionHandler.unselectAll(); this.selectionHandler.unselectAll();
this.showManipulatorToolbar(); this.showManipulatorToolbar();
} }

Loading…
Cancel
Save