1
0
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:
Nick O'Leary 2018-10-29 20:55:35 +00:00
parent d96d3064d6
commit 7b28ba6078
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -2442,14 +2442,14 @@ RED.view = (function() {
thisNode.selectAll(".node_button_button").attr("cursor",function(d) {
return (activeSubflow||!isButtonEnabled(d))?"":"pointer";
});
thisNode.selectAll(".node_right_button").attr("transform",function(d){
var x = d.w-6;
thisNode.selectAll(".node_button").attr("transform",function(d){
var x = d._def.align == "right"?d.w-6:-25;
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)";
});
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) {
return d[d._def.button.toggle]?1:0.2;
}