From fe2ca0f33ac9b75868926dd176bcacd88e50bf4b Mon Sep 17 00:00:00 2001 From: philipp Date: Fri, 16 Feb 2024 10:47:28 +0100 Subject: [PATCH] also remove js function for (unnecessary) filtering of months --- frontend/main.ts | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index 1978699..f0e404f 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -461,10 +461,6 @@ function filterAction(activeFilter: string) { filterCoxs(); break; } - case 'filter-months': { - filterMonths(activeFilter) - break; - } } } @@ -482,28 +478,6 @@ function filterCoxs() { }); } -function filterMonths(action: string) { - const months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']; - const monthToggle = document.querySelector('button[data-action="' + action + '"]'); - if(monthToggle) { - const currentMonth = monthToggle.dataset.month; - - if(currentMonth) { - const index = months.indexOf(currentMonth); - if (index > -1) { // only splice array when item is found - months.splice(index, 1); // 2nd parameter means remove one item only - } - - Array.prototype.forEach.call(months, (month: HTMLElement) => { - const notThisMonth = document.querySelectorAll('div[data-month="' + month + '"]'); - Array.prototype.forEach.call(notThisMonth, (notThisMonth: HTMLElement) => { - notThisMonth.classList.toggle('hidden'); - }); - }); - } - } - } - function initSearch() { const input = document.querySelector('#filter-js');