Merge remote-tracking branch 'upstream/2023.09-rc' into issue-13535
This commit is contained in:
commit
54b9a0320b
|
@ -66,20 +66,14 @@ function switchCircleViewMode(elm) {
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
function filterList() {
|
function filterList() {
|
||||||
// Declare variables
|
const search = document.getElementById("contacts-search").value.toUpperCase();
|
||||||
var input, filter, ul, li, a, i;
|
const li = document.querySelectorAll("#contact-circle-list>li");
|
||||||
input = document.getElementById("contacts-search");
|
|
||||||
filter = input.value.toUpperCase();
|
|
||||||
li = document.querySelectorAll("#contact-circle-list>li");
|
|
||||||
|
|
||||||
// Loop through all list items, and hide those who don't match the search query
|
for (let i = 0; i < li.length; i++) {
|
||||||
for (i = 0; i < li.length; i++) {
|
let foundInDisplayName = li[i].getElementsByClassName("media-heading")[0].firstChild.textContent.toUpperCase().indexOf(search) > -1;
|
||||||
// Get the heading element
|
let foundInAddr = li[i].getElementsByClassName("contact-entry-url")[0].textContent.toUpperCase().indexOf(search) > -1;
|
||||||
var mh = li[i].getElementsByClassName("media-heading")[0];
|
|
||||||
// The first child of the heading element should contain
|
if (foundInDisplayName || foundInAddr) {
|
||||||
// the text which we want to filter
|
|
||||||
a = mh.firstChild;
|
|
||||||
if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
|
|
||||||
li[i].style.display = "";
|
li[i].style.display = "";
|
||||||
} else {
|
} else {
|
||||||
li[i].style.display = "none";
|
li[i].style.display = "none";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user