Merge pull request #176 from RobTheFiveNine/enhancement/node-menu-sorting

Add ability to automatically sort node types / categories in the context menu
This commit is contained in:
Javi Agenjo
2020-10-01 19:11:01 +02:00
committed by GitHub

View File

@@ -96,6 +96,7 @@
Globals: {}, //used to store vars between graphs
searchbox_extras: {}, //used to add extra features to the search box
auto_sort_node_types: false, // If set to true, will automatically sort node types / categories in the context menus
/**
* Register a node class so it can be listed when the user wants to create a new one
@@ -416,7 +417,7 @@
}
}
return r;
return this.auto_sort_node_types ? r.sort() : r;
},
/**
@@ -440,7 +441,7 @@
for (var i in categories) {
result.push(i);
}
return result;
return this.auto_sort_node_types ? result.sort() : result;
},
//debug purposes: reloads all the js scripts that matches a wildcard