Merge pull request #228 from RobTheFiveNine/bugfix/property-dialog-context-menu

Fix property dialog box incorrectly showing context menus for non combo widget types
This commit is contained in:
Javi Agenjo
2021-06-14 12:26:01 +02:00
committed by GitHub
3 changed files with 12 additions and 12 deletions

View File

@@ -10328,7 +10328,7 @@ LGraphNode.prototype.executeAction = function(action)
innerChange(propname, v);
});
}
else if (type == "enum" || type == "combo")
else if (type == "enum" || type == "combo") {
var str_value = LGraphCanvas.getPropertyPrintableValue( value, options.values );
value_element.innerText = str_value;
@@ -10350,6 +10350,7 @@ LGraphNode.prototype.executeAction = function(action)
return false;
}
});
}
root.content.appendChild(elem);

View File

@@ -4536,19 +4536,17 @@ $jscomp.polyfill("Array.prototype.findIndex", function(x) {
});
} else {
if ("enum" == a || "combo" == a) {
q = l.getPropertyPrintableValue(g, h.values);
q = l.getPropertyPrintableValue(g, h.values), t.innerText = q, t.addEventListener("click", function(a) {
var b = this.parentNode.dataset.property, c = this;
new e.ContextMenu(h.values || [], {event:a, className:"dark", callback:function(a, d, e) {
c.innerText = a;
k(b, a);
return !1;
}}, d);
});
}
}
}
t.innerText = q;
t.addEventListener("click", function(a) {
var b = this.parentNode.dataset.property, c = this;
new e.ContextMenu(h.values || [], {event:a, className:"dark", callback:function(a, d, e) {
c.innerText = a;
k(b, a);
return !1;
}}, d);
});
c.content.appendChild(f);
return f;
};

View File

@@ -10328,7 +10328,7 @@ LGraphNode.prototype.executeAction = function(action)
innerChange(propname, v);
});
}
else if (type == "enum" || type == "combo")
else if (type == "enum" || type == "combo") {
var str_value = LGraphCanvas.getPropertyPrintableValue( value, options.values );
value_element.innerText = str_value;
@@ -10350,6 +10350,7 @@ LGraphNode.prototype.executeAction = function(action)
return false;
}
});
}
root.content.appendChild(elem);