Skip to content

Commit

Permalink
Fixed #430
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed May 28, 2016
1 parent 4c5e060 commit e7b7ede
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ export class Dialog implements AfterViewInit,AfterViewChecked,OnDestroy {
shown: boolean;

contentContainer: any;

positionInitialized: boolean;

constructor(private el: ElementRef, private domHandler: DomHandler, private renderer: Renderer) {}

Expand All @@ -102,6 +104,11 @@ export class Dialog implements AfterViewInit,AfterViewChecked,OnDestroy {
if(this._visible) {
this.onBeforeShow.emit({});

if(!this.positionInitialized) {
this.center();
this.positionInitialized = true;
}

this.el.nativeElement.children[0].style.zIndex = ++DomHandler.zindex;

if(this.showEffect == 'fade')
Expand All @@ -120,7 +127,6 @@ export class Dialog implements AfterViewInit,AfterViewChecked,OnDestroy {

ngAfterViewInit() {
this.contentContainer = this.domHandler.findSingle(this.el.nativeElement, '.ui-dialog-content');
this.center();

if(this.draggable) {
this.documentDragListener = this.renderer.listenGlobal('body', 'mousemove', (event) => {
Expand Down

0 comments on commit e7b7ede

Please sign in to comment.