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

fix error on empty label

This commit is contained in:
Hiroyasu Nishiyama 2020-05-17 11:44:23 +09:00
parent 243915516e
commit 5f5e6ea845

View File

@ -4287,16 +4287,18 @@ if (DEBUG_EVENTS) { console.warn("nodeMouseDown", mouse_mode,d); }
.style("fill", d.style.hasOwnProperty('color')?d.style.color:"#999") .style("fill", d.style.hasOwnProperty('color')?d.style.color:"#999")
.attr("transform","translate("+labelX+","+labelY+")") .attr("transform","translate("+labelX+","+labelY+")")
.attr("text-anchor",labelAnchor); .attr("text-anchor",labelAnchor);
var ypos = 0; if (d.labels) {
g.selectAll(".red-ui-flow-group-label-text").remove(); var ypos = 0;
d.labels.forEach(function (name) { g.selectAll(".red-ui-flow-group-label-text").remove();
label.append("tspan") d.labels.forEach(function (name) {
.classed("red-ui-flow-group-label-text", true) label.append("tspan")
.text(name) .classed("red-ui-flow-group-label-text", true)
.attr("x", 0) .text(name)
.attr("y", ypos); .attr("x", 0)
ypos += 15; .attr("y", ypos);
}); ypos += 15;
});
}
} }
delete dirtyGroups[d.id]; delete dirtyGroups[d.id];