This commit is contained in:
epoberezkin committed 2025-09-21 18:16:53 +00:00
1 parent 154d17f941
commit 8694270986
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -891,7 +891,7 @@ window.addEventListener('scroll',changeHeaderBg);
<p>SimpleX Directory is also available as a <a href="https://smp4.simplex.im/a#lXUjJW5vHYQzoLYgmi8GbxkGP41_kjefFvBrdwg-0Ok" target="_blank">SimpleX chat bot</a>.</p>
<p>Read about <a href="/docs/directory.html">how to add</a> your community.</p>
<div class="search-container">
<input id="search">
<input id="search" autocomplete="off">
<div id="top-pagination" class="pagination">
<button class="text-btn live">Active</button>
<button class="text-btn new">New</button>
+4 -4
View File
@@ -22,11 +22,11 @@ async function initDirectory() {
allEntries = listing.entries
renderEntries('top', bySortPriority, topBtn)
searchInput.addEventListener('input', (e) => renderEntries('top', bySortPriority, topBtn, e.target.value.trim()));
liveBtn.addEventListener('click', () => renderEntries('live', byActiveAtDesc, liveBtn, ''));
newBtn.addEventListener('click', () => renderEntries('new', byCreatedAtDesc, newBtn, ''));
topBtn.addEventListener('click', () => renderEntries('top', bySortPriority, topBtn, ''));
liveBtn.addEventListener('click', () => renderEntries('live', byActiveAtDesc, liveBtn));
newBtn.addEventListener('click', () => renderEntries('new', byCreatedAtDesc, newBtn));
topBtn.addEventListener('click', () => renderEntries('top', bySortPriority, topBtn));
function renderEntries(mode, comparator, btn, search) {
function renderEntries(mode, comparator, btn, search = '') {
if (currentSortMode === mode && search == currentSearch) return;
currentSortMode = mode;
if (location.hash) location.hash = '';