mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
0e7863a6fb
commit
fdc4219b68
@ -53,10 +53,22 @@ RED.search = (function() {
|
|||||||
}
|
}
|
||||||
l = l||n.label||n.name||n.id||"";
|
l = l||n.label||n.name||n.id||"";
|
||||||
|
|
||||||
|
|
||||||
var properties = ['id','type','name','label','info'];
|
var properties = ['id','type','name','label','info'];
|
||||||
if (n._def && n._def.defaults) {
|
const node_def = n && n._def;
|
||||||
properties = properties.concat(Object.keys(n._def.defaults));
|
if (node_def) {
|
||||||
|
if (node_def.defaults) {
|
||||||
|
properties = properties.concat(Object.keys(node_def.defaults));
|
||||||
|
}
|
||||||
|
if (n.type !== "group" && node_def.paletteLabel && node_def.paletteLabel !== node_def.type) {
|
||||||
|
try {
|
||||||
|
const label = ("" + (typeof node_def.paletteLabel === "function" ? node_def.paletteLabel.call(node_def) : node_def.paletteLabel)).toLowerCase();
|
||||||
|
if(label && label !== (""+node_def.type).toLowerCase()) {
|
||||||
|
indexProperty(n, l, label);
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
console.warn(`error indexing ${l}`, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (var i=0;i<properties.length;i++) {
|
for (var i=0;i<properties.length;i++) {
|
||||||
if (n.hasOwnProperty(properties[i])) {
|
if (n.hasOwnProperty(properties[i])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user