Skip to content

Commit

Permalink
Added node id to objects
Browse files Browse the repository at this point in the history
  • Loading branch information
billcavalieri committed Apr 25, 2014
1 parent 1ec37f8 commit 7391f99
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/flowchart.symbol.condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function Condition(chart, options) {
});
if (options.link) { symbol.attr('href', options.link); }
if (options.target) { symbol.attr('target', options.target); }
if (options.key) { symbol.node.id = options.key; }

this.text.attr({
y: symbol.getBBox().height/2
Expand Down
1 change: 1 addition & 0 deletions src/flowchart.symbol.inputoutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function InputOutput(chart, options) {
});
if (options.link) { symbol.attr('href', options.link); }
if (options.target) { symbol.attr('target', options.target); }
if (options.key) { symbol.node.id = options.key; }

this.text.attr({
y: symbol.getBBox().height/2
Expand Down
3 changes: 3 additions & 0 deletions src/flowchart.symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ function Symbol(chart, options, symbol) {
this.next_direction = options.next && options['direction_next'] ? options['direction_next'] : undefined;

this.text = this.chart.paper.text(0, 0, options.text);
//Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t
if (options.key) { this.text.node.id = options.key + 't'; }
this.text.attr({
'text-anchor': 'start',
'font-size': (this.chart.options.symbols[this.symbolType]['font-size'] || this.chart.options['font-size']),
Expand Down Expand Up @@ -52,6 +54,7 @@ function Symbol(chart, options, symbol) {
});
if (options.link) { symbol.attr('href', options.link); }
if (options.target) { symbol.attr('target', options.target); }
if (options.key) { symbol.node.id = options.key; }

this.group.push(symbol);
symbol.insertBefore(this.text);
Expand Down

0 comments on commit 7391f99

Please sign in to comment.