fixed html structure for news sidebar
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user