Kalender auf Smartphones: 2 Monate zurück/voraus rendern, Start bei aktueller Woche
This commit is contained in:
parent
b6136563a7
commit
2ca19dd2fb
5 changed files with 46 additions and 7 deletions
|
|
@ -535,6 +535,19 @@
|
|||
start.addEventListener('change', sync);
|
||||
});
|
||||
|
||||
/* ------------------------------------------------- Kalender: Startwoche */
|
||||
// Auf Smartphones wird ein größerer Zeitraum gerendert; die Ansicht startet
|
||||
// trotzdem bei der aktuellen Woche (bzw. der gewählten Startwoche).
|
||||
document.querySelectorAll('.cal-shell[data-calendar-focus]').forEach((shell) => {
|
||||
const scroller = shell.querySelector('.cal-scroll');
|
||||
const focus = shell.dataset.calendarFocus;
|
||||
if (!scroller || !focus) return;
|
||||
const cell = shell.querySelector(`.cal-cell[data-date="${focus}"]`);
|
||||
if (!cell) return;
|
||||
if (scroller.scrollWidth <= scroller.clientWidth + 4) return;
|
||||
scroller.scrollLeft = Math.max(0, cell.offsetLeft - 8);
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------- Kalender: Ziehen */
|
||||
const calendar = document.querySelector('.cal-shell');
|
||||
if (calendar && window.matchMedia('(pointer: fine)').matches) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* zwischengespeichert, damit niemand veraltete Buchungen sieht.
|
||||
*/
|
||||
|
||||
const VERSION = 'dic-v13';
|
||||
const VERSION = 'dic-v14';
|
||||
const CACHE = VERSION;
|
||||
const BASE = new URL(self.registration.scope).pathname.replace(/\/$/, '');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue