1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Modify id

This commit is contained in:
Yuma Matsuura 2019-09-27 19:17:17 +09:00
parent 17653761b9
commit 7957ec4369

View File

@ -2916,10 +2916,11 @@ RED.view = (function() {
icon_group.style("pointer-events","none"); icon_group.style("pointer-events","none");
} }
var labelLineNumber = (separateTextByLineBreak.length == 0)? 1:separateTextByLineBreak.length; var labelLineNumber = (separateTextByLineBreak.length == 0)? 1:separateTextByLineBreak.length;
var labelId = d.id.replace(".","-");
for(var i=0;i<labelLineNumber;i++) { for(var i=0;i<labelLineNumber;i++) {
var text = node.append("svg:text") var text = node.append("svg:text")
.attr("class","red-ui-flow-node-label") .attr("class","red-ui-flow-node-label")
.attr("id", "red-ui-flow-node-label-"+i) .attr("id", "red-ui-flow-node-label-"+labelId+"-"+i)
.attr("x", 38) .attr("x", 38)
.attr("dy", ".3px") .attr("dy", ".3px")
.attr("text-anchor","start") .attr("text-anchor","start")
@ -3019,11 +3020,12 @@ RED.view = (function() {
var sn = sa.length; var sn = sa.length;
var st = ""; var st = "";
var yp = d.h / 2 - (sn / 2) * 24 + 16 var yp = d.h / 2 - (sn / 2) * 24 + 16
var labelId = d.id.replace(".","-");
if(labelLineNumber<sn) { if(labelLineNumber<sn) {
for(var i=labelLineNumber;i<sn;i++) { for(var i=labelLineNumber;i<sn;i++) {
var text = node.append("svg:text") var text = node.append("svg:text")
.attr("class","red-ui-flow-node-label") .attr("class","red-ui-flow-node-label")
.attr("id","red-ui-flow-node-label-"+i) .attr("id","red-ui-flow-node-label-"+labelId+"-"+i)
.attr("x", 38) .attr("x", 38)
.attr("dy", ".3px") .attr("dy", ".3px")
.attr("text-anchor","start") .attr("text-anchor","start")
@ -3038,12 +3040,12 @@ RED.view = (function() {
} }
} else if (0 < sn && sn < labelLineNumber){ } else if (0 < sn && sn < labelLineNumber){
for(var i=sn;i<labelLineNumber;i++) { for(var i=sn;i<labelLineNumber;i++) {
thisNode.select("#red-ui-flow-node-label-"+i).remove(); thisNode.select("#red-ui-flow-node-label-"+labelId+"-"+i).remove();
} }
} }
for (var ic = 0; ic < sn; ic++) { for (var ic = 0; ic < sn; ic++) {
var yn = yp + ic * 24; var yn = yp + ic * 24;
thisNode.select("#red-ui-flow-node-label-"+ic) thisNode.select("#red-ui-flow-node-label-"+labelId+"-"+ic)
.text(function(d,i){ .text(function(d,i){
return separateTextByLineBreak[ic]; return separateTextByLineBreak[ic];
}) })