diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js index dace8e4b0..540f0b4aa 100644 --- a/html/js/noalyss_script.js +++ b/html/js/noalyss_script.js @@ -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'; diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index a18b85a68..86e2f7465 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -1050,8 +1050,18 @@ class HtmlInput return $r; } /** - * Display a field for searching an element in a list + * @brief Display a field for searching an element in a list, the searchable text must be in an element with the className search-content * @param string $p_list_id DOM ID of the list (ul or ol) + * @code + +