minor fixes

This commit is contained in:
tamat
2018-10-24 18:54:06 +02:00
parent ccc30d4cf6
commit cdc3da92b2
2 changed files with 7 additions and 10 deletions

View File

@@ -94,9 +94,9 @@ function TestWidgetsNode()
this.size = this.computeSize();
}
TestWidgetsNode.title = "Test Widgets";
TestWidgetsNode.title = "Widgets";
LiteGraph.registerNodeType("widget/test", TestWidgetsNode );
LiteGraph.registerNodeType("features/widgets", TestWidgetsNode );
//Show value inside the debug console

View File

@@ -7066,7 +7066,7 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
var ref_window = canvas.getCanvasWindow();
var menu_info = null;
var options = { event: event, callback: inner_option_clicked, node: node };
var options = { event: event, callback: inner_option_clicked, extra: node };
//check if mouse is in input
var slot = null;
@@ -7093,14 +7093,10 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
menu_info = this.getNodeMenuOptions(node);
else
{
menu_info = this.getCanvasMenuOptions();
var group = this.graph.getGroupOnPos( event.canvasX, event.canvasY );
if( group ) //on group
{
options.node = group;
menu_info = this.getGroupMenuOptions( group );
}
else
menu_info = this.getCanvasMenuOptions();
menu_info.push({content:"Group", has_submenu: true, submenu: { title:"Group", extra: group, options: this.getGroupMenuOptions( group ) }});
}
}
@@ -7513,7 +7509,7 @@ ContextMenu.prototype.addItem = function( name, value, options )
{
if (value.callback && !options.ignore_item_callbacks && value.disabled !== true ) //item callback
{
var r = value.callback.call( this, value, options, e, that, options.node );
var r = value.callback.call( this, value, options, e, that, options.extra );
if(r === true)
close_parent = false;
}
@@ -7527,6 +7523,7 @@ ContextMenu.prototype.addItem = function( name, value, options )
parentMenu: that,
ignore_item_callbacks: value.submenu.ignore_item_callbacks,
title: value.submenu.title,
extra: value.submenu.extra,
autoopen: options.autoopen
});
close_parent = false;