Skip to content

Commit 667a52b

Browse files
authored
Merge branch 'master' into simeonoff/fix-8172
2 parents f462fa1 + 3b24fbc commit 667a52b

File tree

8 files changed

+37
-2
lines changed

8 files changed

+37
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ All notable changes for each version of this project will be documented in this
1717
- **Breaking Change** - Deprecated the `label` property.
1818
- `igxGridActions`
1919
- Added `asMenuItems` Input for grid actions - `igx-grid-editing-actions`, `igx-grid-pinning-actions`. When set to true will render the related action buttons as separate menu items with button and label.
20+
- `igxNavigationDrawer`
21+
- Added `disableAnimation` property which enables/disables the animation, when toggling the drawer. Set to `false` by default.
22+
- `igxTabs`
23+
- Added `disableAnimation` property which enables/disables the transition animation of the tabs' content. Set to `false` by default.
2024
- `IgxExpansionPanel`
2125
- `IExpansionPanelEventArgs.panel` - Deprecated. Usе `owner` property to get a reference to the panel.
2226

projects/igniteui-angular/src/lib/core/styles/components/navdrawer/_navdrawer-component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,8 @@
8484
@include e(item, header) {
8585
@extend %item--header !optional;
8686
}
87+
88+
@include m(disable-animation) {
89+
@extend %disable-animation !optional;
90+
}
8791
}

projects/igniteui-angular/src/lib/core/styles/components/navdrawer/_navdrawer-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@
434434
transition: none;
435435
visibility: hidden;
436436
}
437+
438+
%disable-animation {
439+
transition-duration: 0s;
440+
}
437441
}
438442

439443
/// Adds typography styles for the igx-navdrawer component.

projects/igniteui-angular/src/lib/navigation-drawer/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The navigation drawer can either sit above content or be pinned alongside it and
6464
| `pinThreshold` | number | Minimum device width required for automatic pin to be toggled. Default is 1024, can be set to a falsy value to disable this behavior. |
6565
| `width` | string| Width of the drawer in its open state. Defaults to "280px".|
6666
| `miniWidth` | string | Width of the drawer in its mini variant. Defaults to "60px". |
67+
| `disableAnimation` | boolean | Enables/disables the animation, when toggling the drawer. Set to `false` by default.
6768

6869
### Outputs
6970
| Name | Description |

projects/igniteui-angular/src/lib/navigation-drawer/navigation-drawer.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<div [hidden]="pin"
1111
class="igx-nav-drawer__overlay"
1212
[class.igx-nav-drawer__overlay--hidden]="!isOpen"
13+
[class.igx-nav-drawer--disable-animation]="disableAnimation"
1314
(click)="close()" #overlay>
1415
</div>
1516
<aside role="navigation"
@@ -18,7 +19,8 @@
1819
[class.igx-nav-drawer__aside--mini]="miniTemplate && !isOpen"
1920
[class.igx-nav-drawer__aside--normal]="!miniTemplate || isOpen"
2021
[class.igx-nav-drawer__aside--pinned]="pin"
21-
[class.igx-nav-drawer__aside--right]="position == 'right'" #aside>
22+
[class.igx-nav-drawer__aside--right]="position == 'right'" #aside
23+
[class.igx-nav-drawer--disable-animation]="disableAnimation">
2224

2325
<ng-container *ngTemplateOutlet="template || defaultItemsTemplate"></ng-container>
2426
</aside>

projects/igniteui-angular/src/lib/navigation-drawer/navigation-drawer.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ export class IgxNavigationDrawerComponent implements
204204
*/
205205
@Input() public width = '280px';
206206

207+
208+
/**
209+
* Enables/disables the animation, when toggling the drawer. Set to `false` by default.
210+
* ````html
211+
* <igx-nav-drawer [disableAnimation]="true"></igx-nav-drawer>
212+
* ````
213+
*/
214+
@HostBinding ('class.igx-nav-drawer--disable-animation')
215+
@Input() public disableAnimation = false;
216+
207217
/**
208218
* Width of the drawer in its mini state. Defaults to 68px.
209219
*

projects/igniteui-angular/src/lib/tabs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ If the total visible items width exceeds the vew port width, scroll buttons are
4949
| `label` | string | Set the tab item text. |
5050
| `disabled` | boolean | Set if the tab is enabled/disabled. |
5151
| `type` | IgxTabsType | Set the tab item sizing mode. By default, `contentfit` is set, the tab item width is sized to its content in the range of min/max width. When the sizing type is `fixed` - all tabs have equal size to fit the view port. |
52+
| `disableAnimation`| boolean | Enables/disables the transition animation of the tabs' content. Set to `false` by default.
5253

5354
## Events
5455

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ export class IgxTabsComponent implements IgxTabsBase, AfterViewInit, OnDestroy {
245245
*/
246246
public visibleItemsWidth: number;
247247

248+
/**
249+
* Enables/disables the transition animation of the tabs' content. Set to `false` by default.
250+
* ````html
251+
* <igx-tabs [disableAnimation]="true"></igx-tabs>
252+
*/
253+
@Input()
254+
public disableAnimation = false;
255+
248256
/**
249257
* @hidden
250258
*/
@@ -462,13 +470,14 @@ export class IgxTabsComponent implements IgxTabsBase, AfterViewInit, OnDestroy {
462470
this.onTabItemSelected.emit({ tab: newTab, group: newTabRelatedGroup });
463471

464472
requestAnimationFrame(() => {
473+
const transitionDuration = this.disableAnimation ? 0 : 0.2;
465474
// bring the new selected tab into view if it is not
466475
this.bringNewTabIntoView(newTab);
467476
// animate the new selection indicator
468477
this.transformIndicatorAnimation(newTab.nativeTabItem.nativeElement);
469478
// animate the new tab's group content
470479
if (!this.hasContentTabs) {
471-
this.transformContentAnimation(newTab, 0.2);
480+
this.transformContentAnimation(newTab, transitionDuration);
472481
}
473482
});
474483
}

0 commit comments

Comments
 (0)