mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
If debug set not to go to sidebar hide the button
Add button.visible function to view.js Make status independant of tosidebar setting
This commit is contained in:
@@ -1961,11 +1961,8 @@ RED.view = (function() {
|
||||
.on("mouseover",function(d){portMouseOver(d3.select(this),d,PORT_TYPE_OUTPUT,0);})
|
||||
.on("mouseout",function(d) {portMouseOut(d3.select(this),d,PORT_TYPE_OUTPUT,0);});
|
||||
|
||||
|
||||
inGroup.append("svg:text").attr("class","port_label").attr("x",18).attr("y",20).style("font-size","10px").text("input");
|
||||
|
||||
|
||||
|
||||
subflowOutputs.each(function(d,i) {
|
||||
if (d.dirty) {
|
||||
var output = d3.select(this);
|
||||
@@ -2306,7 +2303,6 @@ RED.view = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
thisNode.selectAll(".node_tools").attr("x",function(d){return d.w-35;}).attr("y",function(d){return d.h-20;});
|
||||
|
||||
thisNode.selectAll(".node_changed")
|
||||
@@ -2318,8 +2314,8 @@ RED.view = (function() {
|
||||
.classed("hidden",function(d) { return d.valid; });
|
||||
|
||||
thisNode.selectAll(".port_input").each(function(d,i) {
|
||||
var port = d3.select(this);
|
||||
port.attr("transform",function(d){return "translate(-5,"+((d.h/2)-5)+")";})
|
||||
var port = d3.select(this);
|
||||
port.attr("transform",function(d){return "translate(-5,"+((d.h/2)-5)+")";})
|
||||
});
|
||||
|
||||
thisNode.selectAll(".node_icon").attr("y",function(d){return (d.h-d3.select(this).attr("height"))/2;});
|
||||
@@ -2333,21 +2329,30 @@ RED.view = (function() {
|
||||
return (activeSubflow||!isButtonEnabled(d))?"":"pointer";
|
||||
});
|
||||
thisNode.selectAll(".node_right_button").attr("transform",function(d){
|
||||
var x = d.w-6;
|
||||
if (d._def.button.toggle && !d[d._def.button.toggle]) {
|
||||
x = x - 8;
|
||||
}
|
||||
return "translate("+x+",2)";
|
||||
var x = d.w-6;
|
||||
if (d._def.button.toggle && !d[d._def.button.toggle]) {
|
||||
x = x - 8;
|
||||
}
|
||||
return "translate("+x+",2)";
|
||||
});
|
||||
thisNode.selectAll(".node_right_button rect").attr("fill-opacity",function(d){
|
||||
if (d._def.button.toggle) {
|
||||
return d[d._def.button.toggle]?1:0.2;
|
||||
}
|
||||
return 1;
|
||||
if (d._def.button.toggle) {
|
||||
return d[d._def.button.toggle]?1:0.2;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
||||
if (d._def.button && (typeof d._def.button.visible === "function")) { // is defined and a function...
|
||||
if (d._def.button.visible.call(d) === false) {
|
||||
thisNode.selectAll(".node_button").style("display","none");
|
||||
}
|
||||
else {
|
||||
thisNode.selectAll(".node_button").style("display","inherit");
|
||||
}
|
||||
}
|
||||
|
||||
//thisNode.selectAll(".node_right_button").attr("transform",function(d){return "translate("+(d.w - d._def.button.width.call(d))+","+0+")";}).attr("fill",function(d) {
|
||||
// return typeof d._def.button.color === "function" ? d._def.button.color.call(d):(d._def.button.color != null ? d._def.button.color : d._def.color)
|
||||
// return typeof d._def.button.color === "function" ? d._def.button.color.call(d):(d._def.button.color != null ? d._def.button.color : d._def.color)
|
||||
//});
|
||||
|
||||
thisNode.selectAll(".node_badge_group").attr("transform",function(d){return "translate("+(d.w-40)+","+(d.h+3)+")";});
|
||||
|
Reference in New Issue
Block a user