From a5e0a64938bd7e24f0e92f2e46d167c38c7fad2c Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 16 Jun 2020 17:07:32 +0000 Subject: [PATCH] [Library | Trunk]: Full page slider add param for initial state git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58941 d315682c-612b-4755-9ff5-7f18f6832af3 --- utils/full-page-slider/full-page-slider.component.ts | 9 +++++---- utils/full-page-slider/slide.component.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/full-page-slider/full-page-slider.component.ts b/utils/full-page-slider/full-page-slider.component.ts index 938949a8..1031edc6 100644 --- a/utils/full-page-slider/full-page-slider.component.ts +++ b/utils/full-page-slider/full-page-slider.component.ts @@ -1,4 +1,4 @@ -import {AfterContentInit, Component, ContentChildren, QueryList} from "@angular/core"; +import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from "@angular/core"; import {SlideComponent} from "./slide.component"; @Component({ @@ -12,13 +12,14 @@ import {SlideComponent} from "./slide.component"; export class FullPageSliderComponent implements AfterContentInit { @ContentChildren(SlideComponent) slides: QueryList; - + @Input() + public initSlide = 1; public animate: boolean = false; public state = 0; ngAfterContentInit() { - this.setSlides(); - this.state = 1; + this.state = this.initSlide; + this.setSlides(this.state); } setSlides(state = 1) { diff --git a/utils/full-page-slider/slide.component.ts b/utils/full-page-slider/slide.component.ts index 586e9928..ddf91398 100644 --- a/utils/full-page-slider/slide.component.ts +++ b/utils/full-page-slider/slide.component.ts @@ -7,7 +7,7 @@ import {transition, trigger} from "@angular/animations"; template: `
+ style="position: absolute;top: 40%;left: 50%;width: 100%;min-height: 50vh">