From 8346c3fdc063ce710fbb4d573fb352722f363fac Mon Sep 17 00:00:00 2001 From: tamat Date: Thu, 1 Mar 2018 20:13:46 +0100 Subject: [PATCH] fix --- src/litegraph.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 0f6a7e337..68cef4c87 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -49,8 +49,8 @@ var LiteGraph = global.LiteGraph = { ALWAYS: 0, ON_EVENT: 1, - ON_TRIGGER: 1, //the same NEVER: 2, + ON_TRIGGER: 3, proxy: null, //used to redirect calls @@ -5302,7 +5302,7 @@ LGraphCanvas.onMenuNodePin = function( value, options, e, menu, node ) LGraphCanvas.onMenuNodeMode = function( value, options, e, menu, node ) { - new LiteGraph.ContextMenu(["Always","On Event","Never"], {event: e, callback: inner_clicked, parentMenu: prev_menu, node: node }); + new LiteGraph.ContextMenu(["Always","On Event","On Trigger","Never"], {event: e, callback: inner_clicked, parentMenu: menu, node: node }); function inner_clicked(v) { @@ -5311,6 +5311,7 @@ LGraphCanvas.onMenuNodeMode = function( value, options, e, menu, node ) switch(v) { case "On Event": node.mode = LiteGraph.ON_EVENT; break; + case "On Trigger": node.mode = LiteGraph.ON_TRIGGER; break; case "Never": node.mode = LiteGraph.NEVER; break; case "Always": default: @@ -5913,7 +5914,6 @@ ContextMenu.prototype.addItem = function( name, value, options ) ContextMenu.prototype.close = function(e, ignore_parent_menu) { - if( e != undefined && e.which == 0 ) return if(this.root.parentNode) this.root.parentNode.removeChild( this.root ); if(this.parentMenu && !ignore_parent_menu)