Skip to content

Commit

Permalink
Fixed #183
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Apr 26, 2016
1 parent 9767e1c commit 8cc2676
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
4 changes: 1 addition & 3 deletions components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {DomHandler} from '../dom/domhandler';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from 'angular2/common';
import {CONST_EXPR} from 'angular2/src/facade/lang';

declare var PUI: any;

const AUTOCOMPLETE_VALUE_ACCESSOR: Provider = CONST_EXPR(
new Provider(NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => AutoComplete),
Expand Down Expand Up @@ -270,7 +268,7 @@ export class AutoComplete implements AfterViewInit,DoCheck,AfterViewChecked,Cont
show() {
if(!this.panelVisible) {
this.panelVisible = true;
this.panel.style.zIndex = ++PUI.zindex;
this.panel.style.zIndex = ++DomHandler.zindex;
this.domHandler.fadeIn(this.panel, 200);
}
}
Expand Down
8 changes: 3 additions & 5 deletions components/dialog/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {Component,ElementRef,AfterViewInit,AfterViewChecked,OnDestroy,Input,Output,EventEmitter,Renderer} from 'angular2/core';
import {DomHandler} from '../dom/domhandler';

declare var PUI: any;

@Component({
selector: 'p-dialog',
template: `
Expand Down Expand Up @@ -100,7 +98,7 @@ export class Dialog implements AfterViewInit,AfterViewChecked,OnDestroy {
if(this._visible) {
this.onBeforeShow.emit(event);

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

if(this.showEffect == 'fade')
this.domHandler.fadeIn(this.el.nativeElement.children[0], 250);
Expand Down Expand Up @@ -146,7 +144,7 @@ export class Dialog implements AfterViewInit,AfterViewChecked,OnDestroy {
if(this.closeOnEscape && this.closable) {
this.documentEscapeListener = this.renderer.listenGlobal('body', 'keydown', (event) => {
if(event.which == 27) {
if(this.el.nativeElement.children[0].style.zIndex == PUI.zindex) {
if(this.el.nativeElement.children[0].style.zIndex == DomHandler.zindex) {
this.hide(event);
}
}
Expand Down Expand Up @@ -205,7 +203,7 @@ export class Dialog implements AfterViewInit,AfterViewChecked,OnDestroy {
}

moveOnTop() {
this.el.nativeElement.children[0].style.zIndex = ++PUI.zindex;
this.el.nativeElement.children[0].style.zIndex = ++DomHandler.zindex;
}

initDrag(event) {
Expand Down
4 changes: 3 additions & 1 deletion components/dom/domhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import {Injectable} from 'angular2/core';

@Injectable()
export class DomHandler {


public static zindex: number = 1000;

public addClass(element: any, className: string):void {
if (element.classList)
element.classList.add(className);
Expand Down
4 changes: 1 addition & 3 deletions components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {DomHandler} from '../dom/domhandler';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from 'angular2/common';
import {CONST_EXPR} from 'angular2/src/facade/lang';

declare var PUI: any;

const DROPDOWN_VALUE_ACCESSOR: Provider = CONST_EXPR(
new Provider(NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => Dropdown),
Expand Down Expand Up @@ -238,7 +236,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterViewChecked,DoCheck,O
show(panel,container) {
if(this.optionsToDisplay && this.optionsToDisplay.length) {
this.panelVisible = true;
panel.style.zIndex = ++PUI.zindex;
panel.style.zIndex = ++DomHandler.zindex;
this.domHandler.relativePosition(panel, container);
this.domHandler.fadeIn(panel,250);
}
Expand Down
4 changes: 1 addition & 3 deletions components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {DomHandler} from '../dom/domhandler';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from 'angular2/common';
import {CONST_EXPR} from 'angular2/src/facade/lang';

declare var PUI: any;

const MULTISELECT_VALUE_ACCESSOR: Provider = CONST_EXPR(
new Provider(NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => MultiSelect),
Expand Down Expand Up @@ -231,7 +229,7 @@ export class MultiSelect implements OnInit,AfterViewInit,AfterViewChecked,DoChec

show() {
this.overlayVisible = true;
this.panel.style.zIndex = ++PUI.zindex;
this.panel.style.zIndex = ++DomHandler.zindex;
this.domHandler.relativePosition(this.panel, this.container);
this.domHandler.fadeIn(this.panel, 250);
}
Expand Down
4 changes: 1 addition & 3 deletions components/overlaypanel/overlaypanel.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {Component,Input,Output,OnInit,OnDestroy,EventEmitter,Renderer,ElementRef} from 'angular2/core';
import {DomHandler} from '../dom/domhandler';

declare var PUI: any;

@Component({
selector: 'p-overlayPanel',
template: `
Expand Down Expand Up @@ -89,7 +87,7 @@ export class OverlayPanel implements OnInit, OnDestroy {
this.onBeforeShow.emit(null);
let elementTarget = target||event.currentTarget||event.target;
let container = this.el.nativeElement.children[0];
container.style.zIndex = ++PUI.zindex;
container.style.zIndex = ++DomHandler.zindex;

if(this.visible) {
this.domHandler.absolutePosition(container, elementTarget);
Expand Down

0 comments on commit 8cc2676

Please sign in to comment.