Skip to content

Commit

Permalink
feat: added ability to cancel initial animation, closes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeyone committed Oct 29, 2019
1 parent 614b015 commit 01fdf21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ export class NgToggle implements AfterViewInit, AfterContentInit, AfterViewCheck
* @type {boolean}
*/
@Input() @HostBinding('class.disabled') @HostBinding('class.ng-toggle-disabled') disabled: boolean = false;
/**
* Enable/Disable the toggle initial animations. Can help prevent unwanted animation display.
*/
@Input('disableInitialAnimation')
set outerAnimate(value: boolean) {
this._animate = !value;
}

/**
* @param {boolean} value
Expand Down Expand Up @@ -323,7 +330,7 @@ export class NgToggle implements AfterViewInit, AfterContentInit, AfterViewCheck
if (clearDragEnd) {
this._dragEnd = null;
}
if (this._innerAnimate) {
if (this._innerAnimate && !this._animate) {
this._animate = true;
}
}
Expand Down

0 comments on commit 01fdf21

Please sign in to comment.