Add filter to link node

This commit is contained in:
Nick O'Leary
2020-06-03 15:54:51 +01:00
parent 2ce424b567
commit 139ae547c6
6 changed files with 41 additions and 7 deletions

View File

@@ -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;

View File

@@ -81,4 +81,8 @@
i.fa-times,i.fa-search {
top: 7px;
}
.red-ui-searchBox-resultCount {
top: 3px;
padding: 0 6px;
}
}