IsSMallScreen als globale Variable

This commit is contained in:
rxf
2025-07-27 12:06:56 +02:00
parent 61fd8e7a62
commit 7ad7b34aa9
3 changed files with 22 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ body {
#container, #names { #container, #names {
max-width: 800px; max-width: 800px;
width: 95%; width: 90%;
margin: 20px auto; margin: 20px auto;
padding: 16px; padding: 16px;
border: 2px solid #333; border: 2px solid #333;
@@ -33,7 +33,7 @@ h5 {
font-size: 1rem; font-size: 1rem;
border: 1px solid #aaa; border: 1px solid #aaa;
border-radius: 4px; border-radius: 4px;
width: 60%; width: 55%;
max-width: 100%; max-width: 100%;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;

View File

@@ -49,6 +49,7 @@ Beobachtergruppe Sternwarte Welzheim`,
let abgesagt = false; let abgesagt = false;
let actualdate; let actualdate;
let isSmallScreen = false
function $(selector) { function $(selector) {
return document.querySelector(selector); return document.querySelector(selector);
@@ -334,7 +335,7 @@ Beobachtergruppe Sternwarte Welzheim`,
$('#names').style.display = 'block'; $('#names').style.display = 'block';
} }
function switchText(isSmallScreen) { function switchText() {
const thead = document.createElement('thead'); const thead = document.createElement('thead');
const row = document.createElement('tr'); const row = document.createElement('tr');
let column = query.storno ? "col-2" : "col-3" let column = query.storno ? "col-2" : "col-3"
@@ -390,16 +391,18 @@ Beobachtergruppe Sternwarte Welzheim`,
const count = await fetchFromDbase({cmd: 'GET_COUNTS', fdate: d.datum}); const count = await fetchFromDbase({cmd: 'GET_COUNTS', fdate: d.datum});
const isFuehrung = (count && count > 0) ? '' : 'disabled'; const isFuehrung = (count && count > 0) ? '' : 'disabled';
let datstr let datstr
let grpstr
if (query.typ == 'regular') { if (query.typ == 'regular') {
datstr = bauDate(d.wtag, d.datum, d.uhrzeit) datstr = bauDate(d.wtag, d.datum, d.uhrzeit)
grpstr = `(${d.grp})`
} else { } else {
datstr = bauDate('So', d.datum, '11') datstr = bauDate('So', d.datum, '11')
grpstr = " "
} }
select += ` if (isSmallScreen) {
<option value="${d.datum}" ${isselected} ${isFuehrung}> ${datstr} ${grpstr} ${count || 0} Besucher</option>`; select += `
<option value="${d.datum}" ${isselected} ${isFuehrung}> ${datstr} </option>`;
} else {
select += `
<option value="${d.datum}" ${isselected} ${isFuehrung}> ${datstr} (${d.grp}) ${count || 0} Besucher</option>`;
}
i++; i++;
summ += count ? parseInt(count) : 0; summ += count ? parseInt(count) : 0;
if (d.datum >= last) break; if (d.datum >= last) break;
@@ -424,15 +427,17 @@ Beobachtergruppe Sternwarte Welzheim`,
const dates = await fetchFromDbase({cmd:'GET_DATES', anzahl:n, date: today}); const dates = await fetchFromDbase({cmd:'GET_DATES', anzahl:n, date: today});
const last = await fetchFromDbase({cmd:'GET_LASTANMELDUNG', date: today}); const last = await fetchFromDbase({cmd:'GET_LASTANMELDUNG', date: today});
const index = await buildFuehrungsDates(dates, last);
let mq = window.matchMedia('(max-width: 800px)'); let mq = window.matchMedia('(max-width: 800px)');
switchText(mq.matches); isSmallScreen = mq.matches
switchText();
mq.addEventListener('change', (e) => { mq.addEventListener('change', (e) => {
switchText(e.matches); isSmallScreen = e.matches
switchText();
showAktAnmeldungen(actualdate); showAktAnmeldungen(actualdate);
}); });
const index = await buildFuehrungsDates(dates, last);
await showAktAnmeldungen(dates[index].datum); await showAktAnmeldungen(dates[index].datum);
if (query.name !== 'Null') { if (query.name !== 'Null') {
await findName(query.name); await findName(query.name);

View File

@@ -1,12 +1,15 @@
// VersiosNummern und -Geschichte // VersiosNummern und -Geschichte
const VERSION="1.7.1"; const VERSION="1.7.2";
const VDATE="2025-07-21"; const VDATE="2025-07-27";
/* History /* History
Rev. Datum Entwickler Rev. Datum Entwickler
1.7.2 2025-07-27 rxf
- Selectzeile einfacher bei kleinem Display
1.7.1 2025-07-21 rxf 1.7.1 2025-07-21 rxf
- sonnef komplett entfernt - das ist nun komplett in anmeld.js mit drin - sonnef komplett entfernt - das ist nun komplett in anmeld.js mit drin
- anmled.php umbenannt in index.php - anmled.php umbenannt in index.php