From 7b28ba6078709ad777d9c997d995c80c99a78436 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 29 Oct 2018 20:55:35 +0000 Subject: [PATCH] Allow left-hand node button to act as toggle --- .../@node-red/editor-client/src/js/ui/view.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 83a2a6826..474d9f1a1 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -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; }