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

View File

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

View File

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