Skip to content

Commit

Permalink
Allow custom content to expand the step
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicola committed Sep 30, 2018
1 parent 116b658 commit 45d5df1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lib/src/components/step/joyride-step.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@
font-weight: bold;
font-size: 14px;
}
&__counter-container {
margin-right: 10px;
}
}
10 changes: 9 additions & 1 deletion src/lib/src/components/step/joyride-step.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class JoyrideStepComponent implements OnInit, OnDestroy, AfterViewInit {
}

ngAfterViewInit() {
if (this.step.stepContent) {
if (this.isCustomized()) {
this.stepWidth = this.stepContainer.nativeElement.clientWidth;
this.stepHeight = this.stepContainer.nativeElement.clientHeight;
}
Expand All @@ -113,6 +113,14 @@ export class JoyrideStepComponent implements OnInit, OnDestroy, AfterViewInit {
this.drawStep();
}

private isCustomized() {
return this.step.stepContent
|| this.templateService.getCounter()
|| this.templateService.getPrevButton()
|| this.templateService.getNextButton()
|| this.templateService.getDoneButton()
}

private drawStep() {
let position = this.step.isElementOrAncestorFixed ? 'fixed' : 'absolute';
this.renderer.setStyle(this.stepHolder.nativeElement, "position", position);
Expand Down

0 comments on commit 45d5df1

Please sign in to comment.