Fix node button mouse pointer css

This commit is contained in:
Nick O'Leary 2020-06-22 14:37:52 +01:00
parent 581f71911a
commit 0a411cbe4f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 10 additions and 3 deletions

View File

@ -3557,7 +3557,6 @@ RED.view = (function() {
bgButton.setAttribute("width",16);
bgButton.setAttribute("height",node_height-12);
bgButton.setAttribute("fill", RED.utils.getNodeColor(d.type,d._def));
bgButton.setAttribute("cursor","pointer");
d3.select(bgButton)
.on("mousedown",function(d) {if (!lasso && isButtonEnabled(d)) {focusView();d3.select(this).attr("fill-opacity",0.2);d3.event.preventDefault(); d3.event.stopPropagation();}})
.on("mouseup",function(d) {if (!lasso && isButtonEnabled(d)) { d3.select(this).attr("fill-opacity",0.4);d3.event.preventDefault();d3.event.stopPropagation();}})
@ -3904,8 +3903,7 @@ RED.view = (function() {
if (d._def.button) {
var buttonEnabled = isButtonEnabled(d);
this.__buttonGroup__.setAttribute("opacity", !buttonEnabled?0.4:1 );
this.__buttonGroupButton__.setAttribute("cursor",buttonEnabled?"":"pointer");
this.__buttonGroup__.classList.toggle("red-ui-flow-node-button-disabled", !buttonEnabled);
var x = d._def.align == "right"?d.w-6:-25;
if (d._def.button.toggle && !d[d._def.button.toggle]) {

View File

@ -153,6 +153,15 @@
.red-ui-flow-node-button {
fill: inherit;
&.red-ui-flow-node-button-disabled {
opacity: 0.4;
.red-ui-flow-node-button-button {
cursor: default;
}
}
}
.red-ui-flow-node-button-button {
cursor: pointer;
}
.red-ui-flow-node-button-background {
fill: $node-background-placeholder;