From 57f9bfcfb00893d84d4cba0940491c39cb59874e Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 20 Mar 2026 07:24:34 +0000 Subject: [PATCH] Show indicatio if filter is set --- application/views/logbookadvanced/index.php | 12 ++++++ assets/js/sections/logbookadvanced.js | 42 +++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 3e3cca5e8..aa2bf70a5 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -263,6 +263,18 @@ padding-right: 5px; padding-left: 5px; } + .btn-filter-active { + background-color: #ffc107 !important; + border-color: #ffc107 !important; + color: #000 !important; + } + .btn-filter-active:hover { + background-color: #e0a800 !important; + border-color: #e0a800 !important; + } + .btn-filter-active .fas { + color: #000 !important; + } { + const $el = $(selector); + if (!$el.length) return false; + const val = $el.val(); + if (Array.isArray(val)) { + return false; + } + return val && val !== '*' && val !== '' && val !== 'All'; + }); +} + +function updateFilterButtonStates() { + const hasActive = hasActiveFilters(); + + if (hasActive) { + $('#filterDropdown').addClass('btn-filter-active'); + } else { + $('#filterDropdown').removeClass('btn-filter-active'); + } +} + function rebind_checkbox_trigger() { $('#checkBoxAll').change(function (event) { if (this.checked) { @@ -1960,6 +2000,7 @@ function saveOptions() { dateTo.value = ''; break; } + updateFilterButtonStates(); } // Reset dates function @@ -1968,6 +2009,7 @@ function saveOptions() { const dateTo = document.getElementById('dateTo'); dateFrom.value = ''; dateTo.value = ''; + updateFilterButtonStates(); } function checkUpdateDistances() {