Slider tabs: Fix initialization.
This commit is contained in:
parent
9855f5c179
commit
584f1d22f8
|
@ -145,7 +145,13 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.tabs.changes.subscribe(tabs => {
|
this.initTabs();
|
||||||
|
this.tabs.changes.subscribe(() => {
|
||||||
|
this.initTabs();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public initTabs() {
|
||||||
if (typeof document !== 'undefined' && this.tabs.length > 0) {
|
if (typeof document !== 'undefined' && this.tabs.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.position === 'horizontal') {
|
if (this.position === 'horizontal') {
|
||||||
|
@ -174,7 +180,6 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private scrollToStart() {
|
private scrollToStart() {
|
||||||
|
|
Loading…
Reference in New Issue