Adjust tabbar
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -50,6 +50,7 @@ function syncRecipeScrollShadow() {
|
||||
function syncRecipeTopbarUI() {
|
||||
const searchWrap = document.getElementById('recipe-search-wrap');
|
||||
const searchShell = document.getElementById('recipe-search-shell');
|
||||
const rightWrap = document.getElementById('recipe-filter-wrap');
|
||||
const rightBtn = document.getElementById('recipe-filter-btn');
|
||||
const rightIcon = document.getElementById('recipe-right-btn-icon');
|
||||
const filterCount = document.getElementById('recipe-filter-count');
|
||||
@@ -62,14 +63,16 @@ function syncRecipeTopbarUI() {
|
||||
searchShell.style.transform = isOpen ? 'translateY(0) scale(1)' : 'translateY(0.45rem) scale(0.98)';
|
||||
}
|
||||
if (rightIcon) {
|
||||
rightIcon.className = `fas ${isOpen ? 'fa-xmark' : 'fa-sliders-h'}`;
|
||||
rightIcon.className = 'fas fa-xmark';
|
||||
}
|
||||
if (rightBtn) {
|
||||
rightBtn.setAttribute('aria-label', isOpen ? 'Zamknij wyszukiwanie' : 'Otwórz filtry');
|
||||
rightBtn.setAttribute('aria-label', 'Zamknij wyszukiwanie');
|
||||
}
|
||||
if (rightWrap) {
|
||||
rightWrap.classList.toggle('hidden', !isOpen);
|
||||
}
|
||||
if (filterCount) {
|
||||
const activeCount = Number.parseInt(filterCount.textContent || '0', 10) || 0;
|
||||
const showCount = !isOpen && activeCount > 0;
|
||||
const showCount = false;
|
||||
filterCount.classList.toggle('hidden', !showCount);
|
||||
filterCount.classList.toggle('flex', showCount);
|
||||
}
|
||||
@@ -191,9 +194,7 @@ export function setupRecipeList() {
|
||||
e.stopPropagation();
|
||||
if (recipeSearchOpen) {
|
||||
setSearchOpen(false, { clearQuery: true });
|
||||
return;
|
||||
}
|
||||
window.openFilters?.('recipes');
|
||||
});
|
||||
|
||||
document.getElementById('recipe-grid')?.addEventListener('click', (e) => {
|
||||
|
||||
Reference in New Issue
Block a user