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() {