Browse Source

Merge pull request #1796 from abxu/fixed-updating-arrows-string-type

Fixed updating directions of the arrows with the string type
codeClimate
Alex 8 years ago
parent
commit
b19af5fe66
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      lib/network/modules/components/Edge.js

+ 4
- 4
lib/network/modules/components/Edge.js View File

@ -142,9 +142,9 @@ class Edge {
if (newOptions.arrows !== undefined && newOptions.arrows !== null) {
if (typeof newOptions.arrows === 'string') {
let arrows = newOptions.arrows.toLowerCase();
if (arrows.indexOf("to") != -1) {parentOptions.arrows.to.enabled = true;}
if (arrows.indexOf("middle") != -1) {parentOptions.arrows.middle.enabled = true;}
if (arrows.indexOf("from") != -1) {parentOptions.arrows.from.enabled = true;}
parentOptions.arrows.to.enabled = arrows.indexOf("to") != -1;
parentOptions.arrows.middle.enabled = arrows.indexOf("middle") != -1;
parentOptions.arrows.from.enabled = arrows.indexOf("from") != -1;
}
else if (typeof newOptions.arrows === 'object') {
util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'to', allowDeletion, globalOptions.arrows);
@ -536,4 +536,4 @@ class Edge {
}
}
export default Edge;
export default Edge;

Loading…
Cancel
Save