Calendar: long descriptions scroll in their box instead of stretching the entry
A member asked for long calendar posts to be shortened with a scrollbar. The description of a member entry now shows at most a good five lines; the rest scrolls inside the box with the gold scrollbar, so title, participants and buttons stay in view. - While more text follows below, the bottom edge fades out (.has-more, set by assets/js/calendar.js on load, scroll and resize) - on phones the scrollbar only shows while scrolling. - calendar.js is now loaded for everyone, not only for members who may create entries; the map picker part still does nothing without its dialog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d97268f0e9
commit
981afc9321
3 changed files with 29 additions and 2 deletions
|
|
@ -7051,7 +7051,14 @@ a.calendar-agenda-entry:hover { text-decoration: none; filter: brightness(1.2);
|
||||||
.calendar-member-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; }
|
.calendar-member-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; }
|
||||||
.calendar-member-title { font-size: 1rem; }
|
.calendar-member-title { font-size: 1rem; }
|
||||||
.calendar-member-author { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; font-size: 0.85rem; }
|
.calendar-member-author { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; font-size: 0.85rem; }
|
||||||
.calendar-member-description { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
|
/* Lange Beschreibungen scrollen in ihrem Feld, statt den Termin endlos lang zu machen: gut 5 Zeilen, die
|
||||||
|
angeschnittene letzte Zeile zeigt, dass noch mehr kommt */
|
||||||
|
.calendar-member-description { max-height: 8.25em; margin: 0; padding-right: 0.4rem; overflow-y: auto; font-size: 0.9rem; overflow-wrap: anywhere; }
|
||||||
|
/* Unten kommt noch Text (assets/js/calendar.js): der Rand blendet aus */
|
||||||
|
.calendar-member-description.has-more {
|
||||||
|
-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2em), transparent);
|
||||||
|
mask-image: linear-gradient(to bottom, #000 calc(100% - 2em), transparent);
|
||||||
|
}
|
||||||
.calendar-member-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
|
.calendar-member-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
|
||||||
/* Teilnehmer eines Mitglieder-Termins: Avatar-Reihe, aufklappbar zur Liste mit Namen */
|
/* Teilnehmer eines Mitglieder-Termins: Avatar-Reihe, aufklappbar zur Liste mit Namen */
|
||||||
.calendar-member-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
|
.calendar-member-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,27 @@
|
||||||
/**
|
/**
|
||||||
* Kalender: Treffpunkt eines Termins auf der Karte auswaehlen. Die Karte laeuft im Fenster
|
* Kalender: Treffpunkt eines Termins auf der Karte auswaehlen. Die Karte laeuft im Fenster
|
||||||
* (map_frame.php?pick=1, der Viewer aus assets/map/) und schickt den gewaehlten Ort per postMessage zurueck.
|
* (map_frame.php?pick=1, der Viewer aus assets/map/) und schickt den gewaehlten Ort per postMessage zurueck.
|
||||||
|
*
|
||||||
|
* Dazu: Lange Beschreibungen von Mitglieder-Terminen scrollen in ihrem Feld (CSS). Solange darunter noch Text
|
||||||
|
* kommt, blendet der untere Rand aus (.has-more) - auch am Handy, wo der Scrollbalken erst beim Scrollen erscheint.
|
||||||
*/
|
*/
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var descriptions = document.querySelectorAll('.calendar-member-description');
|
||||||
|
function update(el) {
|
||||||
|
el.classList.toggle('has-more', el.scrollHeight - el.clientHeight - el.scrollTop > 1);
|
||||||
|
}
|
||||||
|
function updateAll() {
|
||||||
|
descriptions.forEach(update);
|
||||||
|
}
|
||||||
|
descriptions.forEach(function (el) {
|
||||||
|
el.addEventListener('scroll', function () { update(el); }, { passive: true });
|
||||||
|
});
|
||||||
|
updateAll();
|
||||||
|
window.addEventListener('resize', updateAll);
|
||||||
|
})();
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,6 @@ include __DIR__ . '/includes/header.php';
|
||||||
<iframe title="Karte - Ort auswählen" data-map-frame></iframe>
|
<iframe title="Karte - Ort auswählen" data-map-frame></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="<?= e(asset_url('/assets/js/calendar.js')) ?>"></script>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<script src="<?= e(asset_url('/assets/js/calendar.js')) ?>"></script>
|
||||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue