mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add filter to link node
This commit is contained in:
@@ -773,10 +773,12 @@
|
||||
}
|
||||
},
|
||||
filter: function(filterFunc,expandResults) {
|
||||
var totalCount = 0;
|
||||
var filter = function(item) {
|
||||
var matchCount = 0;
|
||||
if (filterFunc && filterFunc(item)) {
|
||||
matchCount++;
|
||||
totalCount++;
|
||||
}
|
||||
var childCount = 0;
|
||||
if (item.children && typeof item.children !== "function") {
|
||||
@@ -799,11 +801,13 @@
|
||||
}
|
||||
}
|
||||
if (!filterFunc) {
|
||||
totalCount++;
|
||||
return true
|
||||
}
|
||||
return matchCount > 0
|
||||
}
|
||||
return this._topList.editableList('filter', filter);
|
||||
this._topList.editableList('filter', filter);
|
||||
return totalCount;
|
||||
},
|
||||
get: function(id) {
|
||||
return this._items[id] || null;
|
||||
|
Reference in New Issue
Block a user