This commit is contained in:
2026-09-14 22:30:09 +02:00
parent 22ffc3b51a
commit 912deeb28e
42 changed files with 2998 additions and 618 deletions
+9 -4
View File
@@ -181,9 +181,6 @@
if (data.success) {
addChip(data.added);
showStatus(addStatus, '"' + escapeHtml(data.added.tag) + '" (#' + data.added.id + ') added.', true);
document.getElementById('nsfp-search').value = '';
document.getElementById('search-dropdown').style.display = 'none';
lastResults = [];
} else {
showStatus(addStatus, 'Error: ' + (data.msg || 'Add failed'), false);
}
@@ -230,7 +227,8 @@
}
var searchTimer = null;
document.getElementById('nsfp-search').addEventListener('input', function () {
var searchInput = document.getElementById('nsfp-search');
searchInput.addEventListener('input', function () {
clearTimeout(searchTimer);
var q = this.value.trim();
if (!q) { lastResults = []; document.getElementById('search-dropdown').style.display = 'none'; return; }
@@ -245,6 +243,13 @@
}, 250);
});
searchInput.addEventListener('focus', function () {
var q = this.value.trim();
if (q && lastResults.length) {
rebuildDropdown(q);
}
});
document.addEventListener('click', function (e) {
if (!e.target.closest('.nsfp-search-wrap')) {
document.getElementById('search-dropdown').style.display = 'none';