Skip to content

Commit

Permalink
SVY-18496 courasel foundset - update
Browse files Browse the repository at this point in the history
  • Loading branch information
cPecican committed Sep 5, 2023
1 parent efddfff commit 9ecaaca
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ export class ServoyBootstrapExtraCarousel extends ServoyBaseComponent<HTMLDivEle
svyOnChanges( changes: SimpleChanges ) {
if ( changes ) {
if ( changes.slidesFoundset ) {
this.createSlides();
if (!this.innerSlides || (this.innerSlides.length != this.slidesFoundset.serverSize)) {
this.createSlides();
} else {
const index = changes.slidesFoundset.currentValue.selectedRowIndexes[0];
this.setSelectedIndex(index);
}
}
if ( changes.imageOptions ) {
const currentValue = changes.imageOptions.currentValue;
Expand Down Expand Up @@ -99,8 +104,9 @@ export class ServoyBootstrapExtraCarousel extends ServoyBaseComponent<HTMLDivEle
}

setSelectedIndex( index: number ) {
this.ngCarousel.activeId = this.servoyApi.getMarkupId() + '-' + index;
this.ngCarousel.select( this.ngCarousel.activeId );
this.ngCarousel.pause();
this.ngCarousel.select( this.servoyApi.getMarkupId() + '-' + index );
this.ngCarousel.cycle();
}

getStyle(): any {
Expand Down

0 comments on commit 9ecaaca

Please sign in to comment.