mirror of https://github.com/node-red/node-red.git
Merge pull request #5154 from GogoVega/typedInput-node-filter
Node filter support for typedInput's builtin nodepull/5158/head
commit
edf9fe1050
|
@ -519,10 +519,25 @@
|
|||
}
|
||||
},
|
||||
expand: function () {
|
||||
var that = this;
|
||||
const that = this;
|
||||
let filter;
|
||||
if (that.options.node) {
|
||||
let nodeFilter = that.options.node.filter;
|
||||
if ((typeof nodeFilter === "string" || typeof nodeFilter === "object") && nodeFilter) {
|
||||
if (!Array.isArray(nodeFilter)) {
|
||||
nodeFilter = [nodeFilter];
|
||||
}
|
||||
filter = function (node) {
|
||||
return nodeFilter.includes(node.type);
|
||||
};
|
||||
} else if (typeof nodeFilter === "function") {
|
||||
filter = nodeFilter;
|
||||
}
|
||||
}
|
||||
RED.tray.hide();
|
||||
RED.view.selectNodes({
|
||||
single: true,
|
||||
filter: filter,
|
||||
selected: [that.value()],
|
||||
onselect: function (selection) {
|
||||
that.value(selection.id);
|
||||
|
|
Loading…
Reference in New Issue