Pārlūkot izejas kodu

Merge pull request #347 from FrankBoesing/gui

Gui - add icon to all conflicting nodes
dds
Paul Stoffregen pirms 4 gadiem
vecāks
revīzija
bb4fbd9f59
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
2 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. Binārs
      gui/icons/attention.png
  2. +7
    -2
      gui/red/ui/view.js

Binārs
gui/icons/attention.png Parādīt failu

Pirms Pēc
Platums: 880  |  Augstums: 833  |  Izmērs: 87KB

+ 7
- 2
gui/red/ui/view.js Parādīt failu

@@ -1027,13 +1027,13 @@ RED.view = (function() {
if (r["shareable"] == false || r2["shareable"] == false) {
console.log("Conflict: shareable '"+r["resource"]+"' "+d.name+" and "+n2.name);
d.requirementError = true;
r2.requirementError = true;
n2.requirementError = true;
}
else
if (r["setting"] != r2["setting"]) {
console.log("Conflict: "+ d.name + " setting['"+r["setting"]+"'] and "+n2.name+" setting['"+r2["setting"]+"']");
d.requirementError = true;
r2.requirementError = true;
n2.requirementError = true;
}
}
});
@@ -1267,6 +1267,7 @@ RED.view = (function() {
//node.append("path").attr("class","node_error").attr("d","M 3,-3 l 10,0 l -5,-8 z");
//node.append("image").attr("class","node_error hidden").attr("xlink:href","icons/node-error.png").attr("x",0).attr("y",-6).attr("width",10).attr("height",9);
//node.append("image").attr("class","node_changed hidden").attr("xlink:href","icons/node-changed.png").attr("x",12).attr("y",-6).attr("width",10).attr("height",10);
node.append("image").attr("class","node_reqerror hidden").attr("xlink:href","icons/error.png").attr("x",0).attr("y",-12).attr("width",20).attr("height",20);
});

node.each(function(d,i) {
@@ -1355,6 +1356,10 @@ RED.view = (function() {
port.attr("y",y)
});

thisNode.selectAll(".node_reqerror")
.attr("x",function(d){return d.w-25-(d.changed?13:0)})
.classed("hidden",function(d) { return !d.requirementError; });

thisNode.selectAll(".node_icon").attr("y",function(d){return (d.h-d3.select(this).attr("height"))/2;});
thisNode.selectAll(".node_icon_shade").attr("height",function(d){return d.h;});
thisNode.selectAll(".node_icon_shade_border").attr("d",function(d){ return "M "+(("right" == d._def.align) ?0:30)+" 1 l 0 "+(d.h-2)});

Notiek ielāde…
Atcelt
Saglabāt