Adjust tabbar

This commit is contained in:
2026-05-07 18:42:54 +02:00
parent 544df5175d
commit 68e5227db1
4 changed files with 111 additions and 28 deletions

View File

@@ -257,6 +257,7 @@ function syncHorizonUI() {
const filterCount = document.getElementById('pantry-filter-count');
const searchWrap = document.getElementById('pantry-search-wrap');
const searchShell = document.getElementById('pantry-search-shell');
const rightWrap = document.getElementById('pantry-filter-bottom-wrap');
const rightBtn = document.getElementById('pantry-filter-bottom-btn');
const rightIcon = document.getElementById('pantry-right-btn-icon');
const searchDot = document.getElementById('pantry-search-active-dot');
@@ -267,6 +268,7 @@ function syncHorizonUI() {
if (compactLabel) compactLabel.textContent = formatHorizonLabel(horizonEndDate);
const activeFilterCount = getActivePantryFilterCount();
isFilterOpen = false;
syncCalendarPopoverVisibility({
popup: popover,
@@ -287,8 +289,8 @@ function syncHorizonUI() {
}
if (filterCount) {
filterCount.textContent = String(activeFilterCount);
filterCount.classList.toggle('hidden', pantrySearchOpen || activeFilterCount === 0);
filterCount.classList.toggle('flex', !pantrySearchOpen && activeFilterCount > 0);
filterCount.classList.toggle('hidden', true);
filterCount.classList.toggle('flex', false);
}
if (searchWrap) searchWrap.classList.toggle('hidden', pantrySearchOpen);
if (searchShell) {
@@ -296,8 +298,9 @@ function syncHorizonUI() {
searchShell.style.pointerEvents = pantrySearchOpen ? 'auto' : 'none';
searchShell.style.transform = pantrySearchOpen ? 'translateY(0) scale(1)' : 'translateY(0.45rem) scale(0.98)';
}
if (rightIcon) rightIcon.className = `fas ${pantrySearchOpen ? 'fa-xmark' : 'fa-sliders-h'}`;
if (rightBtn) rightBtn.setAttribute('aria-label', pantrySearchOpen ? 'Zamknij wyszukiwanie' : 'Otwórz filtry');
if (rightIcon) rightIcon.className = 'fas fa-xmark';
if (rightBtn) rightBtn.setAttribute('aria-label', 'Zamknij wyszukiwanie');
if (rightWrap) rightWrap.classList.toggle('hidden', !pantrySearchOpen);
if (searchDot) searchDot.classList.toggle('hidden', !pantrySearchQuery);
renderCalendarPopover();
@@ -714,9 +717,7 @@ export function setupPantry() {
event.stopPropagation();
if (pantrySearchOpen) {
setPantrySearchOpen(false, { clearQuery: true });
return;
}
toggleFilterPanel();
});
document.getElementById('pantry-filter-clear')?.addEventListener('click', (event) => {
event.stopPropagation();