Fix : Bug cannot filter a list of element
This commit is contained in:
parent
83352b2e6e
commit
8d3f5b6137
2 changed files with 23 additions and 9 deletions
|
|
@ -2266,7 +2266,7 @@ function filter_table(phrase, _id, colnr, start_row) {
|
|||
}
|
||||
/**
|
||||
* filter quickly a list
|
||||
* @param phrase : DOM id of the input text where we find the word to seach
|
||||
* @param phrase : DOM id of the input text where we find the word to seach, the searchable content use the className searchContent
|
||||
* @param _id : id of the list
|
||||
* @returns nothing
|
||||
* @see HtmlInput::filter_list
|
||||
|
|
@ -2277,20 +2277,24 @@ function filter_list(phrase, _id) {
|
|||
var words = $(phrase).value.toLowerCase();
|
||||
var l_list = document.getElementById(_id);
|
||||
|
||||
var ele;
|
||||
|
||||
var tot_found = 0;
|
||||
|
||||
for (var r = 0; r < l_list.childNodes.length; r++) {
|
||||
var found = 0;
|
||||
if (l_list.childNodes[r].nodeType != 1 ){
|
||||
|
||||
if (l_list.childNodes[r].nodeType != 1) {
|
||||
continue;
|
||||
}
|
||||
if (l_list.childNodes[r].childElementCount == 0)
|
||||
{
|
||||
ele = l_list.childNodes[r].innerHTML;
|
||||
} else {
|
||||
ele = l_list.childNodes[r].childNodes[0].innerHTML;
|
||||
let ele = "";
|
||||
let la_content = l_list.childNodes[r].getElementsByClassName("search-content");
|
||||
|
||||
let e = 0;
|
||||
for (e = 0; e < la_content.length; e++) {
|
||||
ele += la_content[e].innerText;
|
||||
}
|
||||
|
||||
console.debug (`ele = ${ele}`);
|
||||
if (ele.toLowerCase().indexOf(words) >= 0) {
|
||||
tot_found++;
|
||||
l_list.childNodes[r].style.display = 'block';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue