Skip to content

Commit 1b6ef03

Browse files
authored
Merge branch 'master' into mkirova/perf-constant-chunkSize-master
2 parents e2b35da + 2b19384 commit 1b6ef03

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

projects/igniteui-angular/src/lib/tabs/tab-item.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { CommonModule } from '@angular/common';
21
import {
32
Component,
43
ElementRef,

projects/igniteui-angular/src/lib/tabs/tabs-group.component.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { CommonModule } from '@angular/common';
21
import {
32
AfterContentInit,
43
AfterViewChecked,
54
Component,
65
ContentChild,
7-
Directive,
86
ElementRef,
97
forwardRef,
108
HostBinding,
119
Inject,
1210
Input,
13-
TemplateRef
11+
TemplateRef,
12+
HostListener
1413
} from '@angular/core';
1514

1615
import { IgxTabItemComponent } from './tab-item.component';
@@ -23,10 +22,6 @@ import { IgxTabItemTemplateDirective } from './tabs.directives';
2322
})
2423

2524
export class IgxTabsGroupComponent implements AfterContentInit, AfterViewChecked {
26-
private _itemStyle = 'igx-tabs-group';
27-
/**
28-
* @hidden
29-
*/
3025
public isSelected = false;
3126

3227
/**
@@ -71,13 +66,6 @@ export class IgxTabsGroupComponent implements AfterContentInit, AfterViewChecked
7166
return 'igx-tabs__group';
7267
}
7368

74-
/**
75-
*@hidden
76-
*/
77-
public get itemStyle(): string {
78-
return this._itemStyle;
79-
}
80-
8169
/**
8270
* An accessor that returns the `IgxTabItemComponent` component.
8371
* ```typescript
@@ -138,6 +126,16 @@ export class IgxTabsGroupComponent implements AfterContentInit, AfterViewChecked
138126
private _element: ElementRef) {
139127
}
140128

129+
130+
@HostListener('window:resize', ['$event'])
131+
public onResize(event) {
132+
if (this.isSelected) {
133+
const contentOffset = this._tabs.tabsContainer.nativeElement.offsetWidth * this.index;
134+
this._tabs.contentsContainer.nativeElement.style.transitionDuration = `0s`;
135+
this._tabs.contentsContainer.nativeElement.style.transform = `translate(${-contentOffset}px)`;
136+
}
137+
}
138+
141139
/**
142140
* @hidden
143141
*/
@@ -163,7 +161,6 @@ export class IgxTabsGroupComponent implements AfterContentInit, AfterViewChecked
163161
*public tab : IgxTabsGroupComponent;
164162
*ngAfterViewInit(){
165163
* this.tab.select();
166-
* this.cdr.detectChanges();
167164
*}
168165
*```
169166
* @param focusDelay A number representing the expected delay.
@@ -196,6 +193,7 @@ export class IgxTabsGroupComponent implements AfterContentInit, AfterViewChecked
196193
}
197194

198195
const contentOffset = this._tabs.tabsContainer.nativeElement.offsetWidth * this.index;
196+
this._tabs.contentsContainer.nativeElement.style.transitionDuration = `0.2s`;
199197
this._tabs.contentsContainer.nativeElement.style.transform = `translate(${-contentOffset}px)`;
200198

201199
this._tabs.selectedIndicator.nativeElement.style.width = `${tabElement.offsetWidth}px`;

projects/igniteui-angular/src/lib/tabs/tabs.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export class IgxTabsComponent implements AfterViewInit {
147147
if (group) {
148148
group.select(50, true);
149149
}
150-
151150
}
152151
}, 0);
153152
}

0 commit comments

Comments
 (0)