From 90b4b71cb52e9e2ea255df653984112432d7c222 Mon Sep 17 00:00:00 2001 From: Johnny McQuade Date: Fri, 13 Jan 2023 15:54:14 +0000 Subject: [PATCH 1/3] feat: exposed 'centre_first_and_last' variable for carousel component, defaulting to false --- .../template/components/carousel/carousel.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/shared/components/template/components/carousel/carousel.component.ts b/src/app/shared/components/template/components/carousel/carousel.component.ts index 7e0d0b0abb..3f4158a898 100644 --- a/src/app/shared/components/template/components/carousel/carousel.component.ts +++ b/src/app/shared/components/template/components/carousel/carousel.component.ts @@ -38,6 +38,11 @@ export class TmplCarouselComponent extends TemplateBaseComponent implements OnIn this.config.loopedSlides = this._row.rows.length; } this.config.centeredSlides = getBooleanParamFromTemplateRow(this._row, "centered_slides", true); + this.config.centeredSlidesBounds = !getBooleanParamFromTemplateRow( + this._row, + "centre_first_and_last", + false + ); this.initialSlide = getNumberParamFromTemplateRow(this._row, "initial_slide_index", 0); } From 61400ce7f5396543ce533e83e3e064c3795aae90 Mon Sep 17 00:00:00 2001 From: Johnny McQuade Date: Fri, 13 Jan 2023 16:11:53 +0000 Subject: [PATCH 2/3] standardised using British over US spelling of 'centre' --- .../template/components/carousel/carousel.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/components/template/components/carousel/carousel.component.ts b/src/app/shared/components/template/components/carousel/carousel.component.ts index 3f4158a898..b24049a5d9 100644 --- a/src/app/shared/components/template/components/carousel/carousel.component.ts +++ b/src/app/shared/components/template/components/carousel/carousel.component.ts @@ -37,7 +37,7 @@ export class TmplCarouselComponent extends TemplateBaseComponent implements OnIn if (this.config.loop) { this.config.loopedSlides = this._row.rows.length; } - this.config.centeredSlides = getBooleanParamFromTemplateRow(this._row, "centered_slides", true); + this.config.centeredSlides = getBooleanParamFromTemplateRow(this._row, "centred_slides", true); this.config.centeredSlidesBounds = !getBooleanParamFromTemplateRow( this._row, "centre_first_and_last", From 4f089f9f4a6c3e2cfc6acfef0ec3291e8c0d3bf9 Mon Sep 17 00:00:00 2001 From: Johnny McQuade Date: Mon, 30 Jan 2023 10:57:53 +0000 Subject: [PATCH 3/3] WIP: debugging swiper 'centeredSlidesBounds' issue --- .../carousel/carousel.component.html | 1 + .../components/carousel/carousel.component.ts | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/app/shared/components/template/components/carousel/carousel.component.html b/src/app/shared/components/template/components/carousel/carousel.component.html index 26ec1b142b..9bc51d6258 100644 --- a/src/app/shared/components/template/components/carousel/carousel.component.html +++ b/src/app/shared/components/template/components/carousel/carousel.component.html @@ -1,4 +1,5 @@