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");
}
var labelLineNumber = (separateTextByLineBreak.length == 0)? 1:separateTextByLineBreak.length;
var labelId = d.id.replace(".","-");
for(var i=0;i<labelLineNumber;i++) {
var text = node.append("svg:text")
.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("dy", ".3px")
.attr("text-anchor","start")
@ -3019,11 +3020,12 @@ RED.view = (function() {
var sn = sa.length;
var st = "";
var yp = d.h / 2 - (sn / 2) * 24 + 16
var labelId = d.id.replace(".","-");
if(labelLineNumber<sn) {
for(var i=labelLineNumber;i<sn;i++) {
var text = node.append("svg:text")
.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("dy", ".3px")
.attr("text-anchor","start")
@ -3038,12 +3040,12 @@ RED.view = (function() {
}
} else if (0 < sn && sn < labelLineNumber){
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++) {
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){
return separateTextByLineBreak[ic];
})