From f5523085cb338e0d8cfafd77cf4c76411051dba4 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Mon, 10 Mar 2014 10:44:52 +0100 Subject: [PATCH] fixed label color bug per #54 --- dist/vis.js | 6 +++++- src/graph/Edge.js | 1 + src/graph/Graph.js | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/vis.js b/dist/vis.js index 01e72848..8c0041fd 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -10494,6 +10494,7 @@ Edge.prototype.setProperties = function(properties, constants) { this.fontSize = constants.edges.fontSize; this.fontFace = constants.edges.fontFace; this.fontColor = constants.edges.fontColor; + if (properties.fontColor !== undefined) {this.fontColor = properties.fontColor;} if (properties.fontSize !== undefined) {this.fontSize = properties.fontSize;} if (properties.fontFace !== undefined) {this.fontFace = properties.fontFace;} @@ -16389,7 +16390,10 @@ Graph.prototype.setOptions = function (options) { } if (!options.edges.fontColor) { - this.constants.edges.fontColor = options.edges.color; + if (options.edges.color !== undefined) { + if (util.isString(options.edges.color)) {this.constants.edges.fontColor = options.edges.color;} + else if (options.edges.color.color !== undefined) {this.constants.edges.fontColor = options.edges.color.color;} + } } // Added to support dashed lines diff --git a/src/graph/Edge.js b/src/graph/Edge.js index b2a5492c..99d4a923 100644 --- a/src/graph/Edge.js +++ b/src/graph/Edge.js @@ -81,6 +81,7 @@ Edge.prototype.setProperties = function(properties, constants) { this.fontSize = constants.edges.fontSize; this.fontFace = constants.edges.fontFace; this.fontColor = constants.edges.fontColor; + if (properties.fontColor !== undefined) {this.fontColor = properties.fontColor;} if (properties.fontSize !== undefined) {this.fontSize = properties.fontSize;} if (properties.fontFace !== undefined) {this.fontFace = properties.fontFace;} diff --git a/src/graph/Graph.js b/src/graph/Graph.js index 0f742b67..25da960f 100644 --- a/src/graph/Graph.js +++ b/src/graph/Graph.js @@ -594,7 +594,10 @@ Graph.prototype.setOptions = function (options) { } if (!options.edges.fontColor) { - this.constants.edges.fontColor = options.edges.color; + if (options.edges.color !== undefined) { + if (util.isString(options.edges.color)) {this.constants.edges.fontColor = options.edges.color;} + else if (options.edges.color.color !== undefined) {this.constants.edges.fontColor = options.edges.color.color;} + } } // Added to support dashed lines