mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow left-hand node button to act as toggle
This commit is contained in:
parent
d96d3064d6
commit
7b28ba6078
@ -2442,14 +2442,14 @@ RED.view = (function() {
|
|||||||
thisNode.selectAll(".node_button_button").attr("cursor",function(d) {
|
thisNode.selectAll(".node_button_button").attr("cursor",function(d) {
|
||||||
return (activeSubflow||!isButtonEnabled(d))?"":"pointer";
|
return (activeSubflow||!isButtonEnabled(d))?"":"pointer";
|
||||||
});
|
});
|
||||||
thisNode.selectAll(".node_right_button").attr("transform",function(d){
|
thisNode.selectAll(".node_button").attr("transform",function(d){
|
||||||
var x = d.w-6;
|
var x = d._def.align == "right"?d.w-6:-25;
|
||||||
if (d._def.button.toggle && !d[d._def.button.toggle]) {
|
if (d._def.button.toggle && !d[d._def.button.toggle]) {
|
||||||
x = x - 8;
|
x = x - (d._def.align == "right"?8:-8);
|
||||||
}
|
}
|
||||||
return "translate("+x+",2)";
|
return "translate("+x+",2)";
|
||||||
});
|
});
|
||||||
thisNode.selectAll(".node_right_button rect").attr("fill-opacity",function(d){
|
thisNode.selectAll(".node_button rect").attr("fill-opacity",function(d){
|
||||||
if (d._def.button.toggle) {
|
if (d._def.button.toggle) {
|
||||||
return d[d._def.button.toggle]?1:0.2;
|
return d[d._def.button.toggle]?1:0.2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user