mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 18:35:49 +00:00
directory: disable search autocomplete
This commit is contained in:
@@ -259,7 +259,7 @@ templateEngineOverride: njk
|
||||
<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</a>.</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>
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user