mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4879 from node-red/fix-link-quick-add
Do not include Junction type in quick-add for virtual links
This commit is contained in:
commit
e6882337c1
@ -335,13 +335,25 @@ RED.typeSearch = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function applyFilter(filter,type,def) {
|
function applyFilter(filter,type,def) {
|
||||||
return !def || !filter ||
|
if (!filter) {
|
||||||
(
|
// No filter; allow everything
|
||||||
(!filter.spliceMultiple) &&
|
return true
|
||||||
(!filter.type || type === filter.type) &&
|
}
|
||||||
(!filter.input || type === 'junction' || def.inputs > 0) &&
|
if (type === 'junction') {
|
||||||
(!filter.output || type === 'junction' || def.outputs > 0)
|
// Only allow Junction is there's no specific type filter
|
||||||
)
|
return !filter.type
|
||||||
|
}
|
||||||
|
if (filter.type) {
|
||||||
|
// Handle explicit type filter
|
||||||
|
return filter.type === type
|
||||||
|
}
|
||||||
|
if (!def) {
|
||||||
|
// No node definition available - allow it
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Check if the filter is for input/outputs and apply
|
||||||
|
return (!filter.input || def.inputs > 0) &&
|
||||||
|
(!filter.output || def.outputs > 0)
|
||||||
}
|
}
|
||||||
function refreshTypeList(opts) {
|
function refreshTypeList(opts) {
|
||||||
var i;
|
var i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user