Browse Source

Fixed updating arrows with the string type

codeClimate
abxu 8 years ago
parent
commit
9af8c49193
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 (newOptions.arrows !== undefined && newOptions.arrows !== null) {
if (typeof newOptions.arrows === 'string') { if (typeof newOptions.arrows === 'string') {
let arrows = newOptions.arrows.toLowerCase(); 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') { else if (typeof newOptions.arrows === 'object') {
util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'to', allowDeletion, globalOptions.arrows); 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