Skip to content

Commit

Permalink
feat(modal): ModalDirective should use config.animated (#3156)
Browse files Browse the repository at this point in the history
  • Loading branch information
flensrocker authored and valorkin committed Dec 4, 2017
1 parent 909e7ae commit f5679eb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/modal/modal.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export class ModalDirective implements OnDestroy, OnInit {
@Output()
onHidden: EventEmitter<ModalDirective> = new EventEmitter<ModalDirective>();

// seems like an Options
isAnimated = true;
/** This field contains last dismiss reason.
* Possible values: `backdrop-click`, `esc` and `null`
* (if modal was closed by direct call of `.hide()`).
Expand Down Expand Up @@ -194,7 +192,7 @@ export class ModalDirective implements OnDestroy, OnInit {
}
// this._addClassIn = false;

if (this.isAnimated) {
if (this._config.animated) {
this.timerHideModal = setTimeout(
() => this.hideModal(),
TRANSITION_DURATION
Expand Down Expand Up @@ -241,7 +239,7 @@ export class ModalDirective implements OnDestroy, OnInit {
0
);

if (this.isAnimated) {
if (this._config.animated) {
Utils.reflow(this._element.nativeElement);
}

Expand All @@ -258,7 +256,7 @@ export class ModalDirective implements OnDestroy, OnInit {
this.onShown.emit(this);
};

if (this.isAnimated) {
if (this._config.animated) {
setTimeout(transitionComplete, TRANSITION_DURATION);
} else {
transitionComplete();
Expand Down Expand Up @@ -303,14 +301,14 @@ export class ModalDirective implements OnDestroy, OnInit {
this._backdrop
.attach(ModalBackdropComponent)
.to('body')
.show({isAnimated: this.isAnimated});
.show({isAnimated: this._config.animated});
this.backdrop = this._backdrop._componentRef;

if (!callback) {
return;
}

if (!this.isAnimated) {
if (!this._config.animated) {
callback();

return;
Expand Down

0 comments on commit f5679eb

Please sign in to comment.