From 9d280f7c6238896167ec807b24eaadbcaab18194 Mon Sep 17 00:00:00 2001 From: Doug Brunner Date: Fri, 16 Nov 2018 13:11:10 -0800 Subject: [PATCH] feat: allow restyling height of toolbar --- src/components/super-tabs-toolbar.ts | 7 +++++++ src/components/super-tabs.ts | 10 +--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/super-tabs-toolbar.ts b/src/components/super-tabs-toolbar.ts index 75fd93c..a5e2ef2 100644 --- a/src/components/super-tabs-toolbar.ts +++ b/src/components/super-tabs-toolbar.ts @@ -97,6 +97,13 @@ export class SuperTabsToolbar implements AfterViewInit, OnDestroy { private rnd: Renderer2 ) {} + get height(): number { + if (!this.el || !this.el.nativeElement) { + return 0; + } + return this.el.nativeElement.getBoundingClientRect().height; + } + ngAfterViewInit() { this.gesture = new SuperTabsPanGesture( this.plt, diff --git a/src/components/super-tabs.ts b/src/components/super-tabs.ts index e144032..3881433 100644 --- a/src/components/super-tabs.ts +++ b/src/components/super-tabs.ts @@ -629,15 +629,7 @@ export class SuperTabsComponent } private refreshContainerHeight() { - let heightOffset = 0; - - if (this._isToolbarVisible) { - if (this.hasTitles && this.hasIcons) { - heightOffset = 72; - } else if (this.hasTitles || this.hasIcons) { - heightOffset = 48; - } - } + const heightOffset = this._isToolbarVisible ? this.toolbar.height : 0; this.rnd.setStyle( this.tabsContainer.getNativeElement(),