Skip to content

Commit

Permalink
fix(docs): delay first calculation of examples' height (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa authored Jul 27, 2018
1 parent c67ec11 commit 9a74fc1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/app/example/example.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AfterViewInit, Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { takeWhile } from 'rxjs/operators';
import { of as observableOf } from 'rxjs';
import { takeWhile, delay } from 'rxjs/operators';
import { NB_DOCUMENT, NbThemeService } from '@nebular/theme';
import { NgdAnalytics, NgdIframeCommunicatorService } from '../@theme/services';

Expand All @@ -27,7 +28,9 @@ export class NgdExampleComponent implements OnInit, AfterViewInit, OnDestroy {
}

ngAfterViewInit() {
this.sendHeight();
observableOf(null)
.pipe(delay(500))
.subscribe(() => this.sendHeight());
}

ngOnDestroy() {
Expand Down

0 comments on commit 9a74fc1

Please sign in to comment.