Skip to content

Commit

Permalink
fixed label color bug per almende#54
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDM0 committed Mar 10, 2014
1 parent 50e650d commit f552308
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dist/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/graph/Edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down
5 changes: 4 additions & 1 deletion src/graph/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f552308

Please sign in to comment.