mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-05 04:52:58 +00:00
Add files via upload
This commit is contained in:
+9
-4
@@ -230,10 +230,16 @@
|
|||||||
|
|
||||||
function filterContacts() {
|
function filterContacts() {
|
||||||
const query = document.getElementById('searchInput').value.toLowerCase().trim();
|
const query = document.getElementById('searchInput').value.toLowerCase().trim();
|
||||||
const activeTab = document.querySelector('.switcher-btn.active').dataset.type;
|
const activeBtn = document.querySelector('.switcher-btn.active');
|
||||||
|
|
||||||
// Get contacts based on active tab
|
if (!activeBtn) {
|
||||||
|
// Default to main contacts if no active button found
|
||||||
|
return displayContacts(allContacts.filter(c => !c.internal), query);
|
||||||
|
}
|
||||||
|
|
||||||
|
const activeTab = activeBtn.dataset.type;
|
||||||
let contacts = [];
|
let contacts = [];
|
||||||
|
|
||||||
if (activeTab === 'main') {
|
if (activeTab === 'main') {
|
||||||
contacts = [...allContacts.filter(c => !c.internal)];
|
contacts = [...allContacts.filter(c => !c.internal)];
|
||||||
} else if (activeTab === 'internal') {
|
} else if (activeTab === 'internal') {
|
||||||
@@ -255,8 +261,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredContacts = contacts;
|
displayContacts(contacts, query);
|
||||||
displayContacts(filteredContacts, query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function highlightText(text, query) {
|
function highlightText(text, query) {
|
||||||
|
|||||||
Reference in New Issue
Block a user