fixed html structure for news sidebar

This commit is contained in:
2026-04-25 13:10:47 +02:00
parent 360eb3744a
commit 62ba9b5345
2 changed files with 44 additions and 14 deletions

View File

@@ -983,6 +983,25 @@ function reverseGeocode(contributionId, lat, lng) {
.catch(function () {});
}
// Filters News Items in Sidebar by Search Term
function filterNews() {
const searchTerm = document.getElementById('news-search-input').value.toLowerCase();
const newsItems = document.querySelectorAll('#news-list .news-item');
newsItems.forEach(function (item) {
const title = item.dataset.title || '';
const content = item.dataset.content || '';
const author = item.dataset.author || '';
// Shows Item if Search Term matches Title, Content or Author
if (!searchTerm || title.indexOf(searchTerm) !== -1 || content.indexOf(searchTerm) !== -1 || author.indexOf(searchTerm) !== -1) {
item.style.display = '';
} else {
item.style.display = 'none';
}
});
}
// =====================================================================
// Block 16: Application Startup