Adjust tabbar
This commit is contained in:
@@ -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