From bc4ac4724fde537068a61c4fa8edc0467d037257 Mon Sep 17 00:00:00 2001 From: RobTheFiveNine <49003204+RobTheFiveNine@users.noreply.github.com> Date: Fri, 11 Jun 2021 20:12:51 +0100 Subject: [PATCH] Add missing brackets that cause context menu bug --- build/litegraph.js | 3 ++- build/litegraph.min.js | 18 ++++++++---------- src/litegraph.js | 3 ++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/litegraph.js b/build/litegraph.js index 3a1034aff..412273979 100644 --- a/build/litegraph.js +++ b/build/litegraph.js @@ -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); diff --git a/build/litegraph.min.js b/build/litegraph.min.js index 4a819e9bc..88ca669c7 100644 --- a/build/litegraph.min.js +++ b/build/litegraph.min.js @@ -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; }; diff --git a/src/litegraph.js b/src/litegraph.js index 7db095b13..6eef7a51a 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -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);