From a4be4f6fb79367cc602834ab2216ae8b034a4ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 12 Nov 2024 15:54:21 +0100 Subject: [PATCH] feat: collapse pickup tables with more than 3 rows --- .../js/controllers/autocollapse_controller.js | 10 ++- .../Private/Templates/Travelinfo/Index.html | 78 ++++++++++++------- 2 files changed, 56 insertions(+), 32 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/autocollapse_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/autocollapse_controller.js index f7a0bbbb..5a0ca436 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/autocollapse_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/autocollapse_controller.js @@ -9,6 +9,10 @@ export default class extends Controller { type: Number, default: 0, }, + height: { + type: Number, + default: 0, + }, expanded: { type: Boolean, default: true, @@ -16,10 +20,10 @@ export default class extends Controller { } connect() { - // Determine height of element controlling max height - this.maxHeight = this.sizerTarget.offsetHeight - // Determine rendered height of element holding content + // Determine height of element controlling max height if available + this.maxHeight = this.hasSizerTarget ? this.sizerTarget.offsetHeight : this.heightValue + // Determine rendered height of element holding content this.contentHeight = this.containerTarget.offsetHeight // Determine height of collapsed content element considering diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html index 9de8c6c5..dbc0754e 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Travelinfo/Index.html @@ -73,35 +73,29 @@ -

- Bus-Zustiege -

- - - - - - - - - - - - - -
- Zustieg - - Datum - - Uhrzeit -
- {pickup.city}
{pickup.street} -
- {pickup.date} - - {f:if(condition: pickup.time, then: '{pickup.time} Uhr', else: '???')} -
+ + + + + +
+
+

+ Bus-Zustiege +

+ +
+ +
+
+
+
+

@@ -219,6 +213,32 @@ + +

+ Bus-Zustiege +

+ + + + + + + + + + + +
+ Zustieg + + Datum/Uhrzeit +
+ {pickup.city}
{pickup.street} +
+ {pickup.date}
{f:if(condition: pickup.time, then: '{pickup.time} Uhr', else: '???')} +
+
+