Fix: breeder.js _esc undefined → ReferenceError → 🚧; Admin-Profil in öffentlicher Suche; Welpen-Chip klickbar (SW by-v896)
This commit is contained in:
parent
0f230b9ddc
commit
8b5805a8ca
7 changed files with 14 additions and 12 deletions
|
|
@ -8,6 +8,8 @@ window.Page_breeder = (() => {
|
|||
let _container = null;
|
||||
let _appState = null;
|
||||
|
||||
const _esc = s => UI.esc ? UI.esc(s) : String(s ?? '').replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// INIT
|
||||
// ----------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -146,13 +146,13 @@ window.Page_litters = (() => {
|
|||
{ icon: 'list-bullets', label: 'Alle Würfe', val: total, filter: null },
|
||||
{ icon: 'baby', label: 'Aktiv', val: aktiv, filter: ['verfuegbar','geboren'], color: 'var(--c-success)' },
|
||||
{ icon: 'calendar-dots',label: 'Geplant', val: geplant, filter: ['geplant'] },
|
||||
{ icon: 'dog', label: 'Welpen ges.', val: welpen, filter: null },
|
||||
{ icon: 'dog', label: 'Welpen ges.', val: welpen, filter: null, noClick: true },
|
||||
{ icon: 'tag', label: 'Verfügbar', val: verfuegb,filter: ['verfuegbar'], color: verfuegb > 0 ? 'var(--c-primary)' : undefined },
|
||||
];
|
||||
bar.style.display = 'flex';
|
||||
bar.innerHTML = statItems.map((s, i) => {
|
||||
const isActive = JSON.stringify(_filterStatus) === JSON.stringify(s.filter);
|
||||
const clickable = s.filter !== undefined && !(s.label === 'Welpen ges.');
|
||||
const clickable = !s.noClick;
|
||||
return `
|
||||
<div data-stat-idx="${i}"
|
||||
style="background:${isActive ? 'var(--c-primary)' : 'var(--c-bg-secondary)'};
|
||||
|
|
@ -171,7 +171,7 @@ window.Page_litters = (() => {
|
|||
|
||||
bar.querySelectorAll('[data-stat-idx]').forEach(chip => {
|
||||
const s = statItems[parseInt(chip.dataset.statIdx)];
|
||||
if (!s.filter && s.label !== 'Alle Würfe') return;
|
||||
if (s.noClick) return;
|
||||
chip.addEventListener('click', () => {
|
||||
_filterStatus = JSON.stringify(_filterStatus) === JSON.stringify(s.filter) ? null : s.filter;
|
||||
_renderStats();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue