mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
Merge pull request #180 from RobTheFiveNine/enhancement/property-descriptors
Change property descriptor terminology + bug fix
This commit is contained in:
@@ -9453,7 +9453,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
entries.push({
|
entries.push({
|
||||||
content:
|
content:
|
||||||
"<span class='property_name'>" +
|
"<span class='property_name'>" +
|
||||||
(info.descriptor ? info.descriptor : i) +
|
(info.label ? info.label : i) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
"<span class='property_value'>" +
|
"<span class='property_value'>" +
|
||||||
value +
|
value +
|
||||||
@@ -10051,7 +10051,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
|
|
||||||
var dialog = this.createDialog(
|
var dialog = this.createDialog(
|
||||||
"<span class='name'>" +
|
"<span class='name'>" +
|
||||||
(info.descriptor ? info.descriptor : property) +
|
(info.label ? info.label : property) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
input_html +
|
input_html +
|
||||||
"<button>OK</button>",
|
"<button>OK</button>",
|
||||||
@@ -10078,8 +10078,12 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
input.addEventListener("blur", function(e) {
|
input.addEventListener("blur", function(e) {
|
||||||
this.focus();
|
this.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
var v = node.properties[property] !== undefined ? node.properties[property] : "";
|
var v = node.properties[property] !== undefined ? node.properties[property] : "";
|
||||||
v = JSON.stringify(v);
|
if (type !== 'string') {
|
||||||
|
v = JSON.stringify(v);
|
||||||
|
}
|
||||||
|
|
||||||
input.value = v;
|
input.value = v;
|
||||||
input.addEventListener("keydown", function(e) {
|
input.addEventListener("keydown", function(e) {
|
||||||
if (e.keyCode != 13) {
|
if (e.keyCode != 13) {
|
||||||
|
|||||||
6
build/litegraph.min.js
vendored
6
build/litegraph.min.js
vendored
@@ -4048,7 +4048,7 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
a = m.getPropertyPrintableValue(a, n.values);
|
a = m.getPropertyPrintableValue(a, n.values);
|
||||||
}
|
}
|
||||||
a = m.decodeHTML(a);
|
a = m.decodeHTML(a);
|
||||||
k.push({content:"<span class='property_name'>" + (n.descriptor ? n.descriptor : p) + "</span><span class='property_value'>" + a + "</span>", value:p});
|
k.push({content:"<span class='property_name'>" + (n.label ? n.label : p) + "</span><span class='property_value'>" + a + "</span>", value:p});
|
||||||
}
|
}
|
||||||
if (k.length) {
|
if (k.length) {
|
||||||
return new f.ContextMenu(k, {event:d, callback:function(a, b, d, e) {
|
return new f.ContextMenu(k, {event:d, callback:function(a, b, d, e) {
|
||||||
@@ -4371,7 +4371,7 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
k += "</select>";
|
k += "</select>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var h = this.createDialog("<span class='name'>" + (c.descriptor ? c.descriptor : b) + "</span>" + k + "<button>OK</button>", d);
|
var h = this.createDialog("<span class='name'>" + (c.label ? c.label : b) + "</span>" + k + "<button>OK</button>", d);
|
||||||
if ("enum" != f && "combo" != f || !c.values) {
|
if ("enum" != f && "combo" != f || !c.values) {
|
||||||
if ("boolean" == f) {
|
if ("boolean" == f) {
|
||||||
(l = h.querySelector("input")) && l.addEventListener("click", function(a) {
|
(l = h.querySelector("input")) && l.addEventListener("click", function(a) {
|
||||||
@@ -4381,7 +4381,7 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
if (l = h.querySelector("input")) {
|
if (l = h.querySelector("input")) {
|
||||||
l.addEventListener("blur", function(a) {
|
l.addEventListener("blur", function(a) {
|
||||||
this.focus();
|
this.focus();
|
||||||
}), n = void 0 !== a.properties[b] ? a.properties[b] : "", n = JSON.stringify(n), l.value = n, l.addEventListener("keydown", function(a) {
|
}), n = void 0 !== a.properties[b] ? a.properties[b] : "", "string" !== f && (n = JSON.stringify(n)), l.value = n, l.addEventListener("keydown", function(a) {
|
||||||
13 == a.keyCode && (e(), a.preventDefault(), a.stopPropagation());
|
13 == a.keyCode && (e(), a.preventDefault(), a.stopPropagation());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9453,7 +9453,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
entries.push({
|
entries.push({
|
||||||
content:
|
content:
|
||||||
"<span class='property_name'>" +
|
"<span class='property_name'>" +
|
||||||
(info.descriptor ? info.descriptor : i) +
|
(info.label ? info.label : i) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
"<span class='property_value'>" +
|
"<span class='property_value'>" +
|
||||||
value +
|
value +
|
||||||
@@ -10051,7 +10051,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
|
|
||||||
var dialog = this.createDialog(
|
var dialog = this.createDialog(
|
||||||
"<span class='name'>" +
|
"<span class='name'>" +
|
||||||
(info.descriptor ? info.descriptor : property) +
|
(info.label ? info.label : property) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
input_html +
|
input_html +
|
||||||
"<button>OK</button>",
|
"<button>OK</button>",
|
||||||
@@ -10078,8 +10078,12 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
input.addEventListener("blur", function(e) {
|
input.addEventListener("blur", function(e) {
|
||||||
this.focus();
|
this.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
var v = node.properties[property] !== undefined ? node.properties[property] : "";
|
var v = node.properties[property] !== undefined ? node.properties[property] : "";
|
||||||
v = JSON.stringify(v);
|
if (type !== 'string') {
|
||||||
|
v = JSON.stringify(v);
|
||||||
|
}
|
||||||
|
|
||||||
input.value = v;
|
input.value = v;
|
||||||
input.addEventListener("keydown", function(e) {
|
input.addEventListener("keydown", function(e) {
|
||||||
if (e.keyCode != 13) {
|
if (e.keyCode != 13) {
|
||||||
|
|||||||
Reference in New Issue
Block a user