Skip to content

Commit

Permalink
Fixed #2628
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Apr 28, 2017
1 parent 439ffbc commit ae34585
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
}

ngAfterViewInit() {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(this.inputClick)
this.inputClick = false;
else
Expand Down
2 changes: 1 addition & 1 deletion components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ export class Calendar implements AfterViewInit,OnInit,OnDestroy,ControlValueAcce

bindDocumentClickListener() {
if(!this.documentClickListener) {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(this.closeOverlay) {
this.overlayVisible = false;
}
Expand Down
2 changes: 1 addition & 1 deletion components/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class ConfirmDialog implements AfterViewInit,OnDestroy {
}

if(this.closeOnEscape && this.closable) {
this.documentEscapeListener = this.renderer.listenGlobal('body', 'keydown', (event) => {
this.documentEscapeListener = this.renderer.listenGlobal('document', 'keydown', (event) => {
if(event.which == 27) {
if(this.el.nativeElement.children[0].style.zIndex == DomHandler.zindex) {
this.hide(event);
Expand Down
4 changes: 2 additions & 2 deletions components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ export class ContextMenu implements AfterViewInit,OnDestroy {
ngAfterViewInit() {
this.container = <HTMLDivElement> this.containerViewChild.nativeElement;

this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
this.hide();
});

if(this.global) {
this.rightClickListener = this.renderer.listenGlobal('body', 'contextmenu', (event) => {
this.rightClickListener = this.renderer.listenGlobal('document', 'contextmenu', (event) => {
this.show(event);
event.preventDefault();
});
Expand Down
6 changes: 3 additions & 3 deletions components/datatable/datatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ export class DataTable implements AfterViewChecked,AfterViewInit,AfterContentIni
}

if(this.editable) {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', (event) => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', (event) => {
if(!this.editorClick) {
this.closeCell();
}
Expand Down Expand Up @@ -1634,13 +1634,13 @@ export class DataTable implements AfterViewChecked,AfterViewInit,AfterContentIni
this.resizerHelper = this.domHandler.findSingle(this.el.nativeElement, 'div.ui-column-resizer-helper');
this.fixColumnWidths();

this.documentColumnResizeListener = this.renderer.listenGlobal('body', 'mousemove', (event) => {
this.documentColumnResizeListener = this.renderer.listenGlobal('document', 'mousemove', (event) => {
if(this.columnResizing) {
this.onColumnResize(event);
}
});

this.documentColumnResizeEndListener = this.renderer.listenGlobal('body', 'mouseup', (event) => {
this.documentColumnResizeEndListener = this.renderer.listenGlobal('document', 'mouseup', (event) => {
if(this.columnResizing) {
this.columnResizing = false;
this.onColumnResizeEnd(event);
Expand Down
8 changes: 4 additions & 4 deletions components/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,17 @@ export class Dialog implements AfterViewInit,OnDestroy {
this.contentContainer = <HTMLDivElement> this.contentViewChild.nativeElement;

if(this.draggable) {
this.documentDragListener = this.renderer.listenGlobal('body', 'mousemove', (event) => {
this.documentDragListener = this.renderer.listenGlobal('document', 'mousemove', (event) => {
this.onDrag(event);
});
}

if(this.resizable) {
this.documentResizeListener = this.renderer.listenGlobal('body', 'mousemove', (event) => {
this.documentResizeListener = this.renderer.listenGlobal('document', 'mousemove', (event) => {
this.onResize(event);
});

this.documentResizeEndListener = this.renderer.listenGlobal('body', 'mouseup', (event) => {
this.documentResizeEndListener = this.renderer.listenGlobal('document', 'mouseup', (event) => {
if(this.resizing) {
this.resizing = false;
}
Expand All @@ -192,7 +192,7 @@ export class Dialog implements AfterViewInit,OnDestroy {
}

if(this.closeOnEscape && this.closable) {
this.documentEscapeListener = this.renderer.listenGlobal('body', 'keydown', (event) => {
this.documentEscapeListener = this.renderer.listenGlobal('document', 'keydown', (event) => {
if(event.which == 27) {
if(parseInt(this.container.style.zIndex) == DomHandler.zindex) {
this.close(event);
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView

bindDocumentClickListener() {
if(!this.documentClickListener) {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(!this.selfClick&&!this.itemClick) {
this.panelVisible = false;
this.unbindDocumentClickListener();
Expand Down
2 changes: 1 addition & 1 deletion components/lightbox/lightbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class Lightbox implements AfterViewInit,OnDestroy{
this.domHandler.appendChild(this.panel, this.appendTo);
}

this.documentClickListener = this.renderer.listenGlobal('body', 'click', (event) => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', (event) => {
if(!this.preventDocumentClickListener&&this.visible) {
this.hide(event);
}
Expand Down
2 changes: 1 addition & 1 deletion components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class Menu implements AfterViewInit,OnDestroy {
this.domHandler.appendChild(this.container, this.appendTo);
}

this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(!this.preventDocumentDefault) {
this.hide();
}
Expand Down
2 changes: 1 addition & 1 deletion components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class MultiSelect implements OnInit,AfterViewInit,AfterViewChecked,DoChec
ngOnInit() {
this.updateLabel();

this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(!this.selfClick && !this.panelClick && this.overlayVisible) {
this.hide();
}
Expand Down
2 changes: 1 addition & 1 deletion components/overlaypanel/overlaypanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class OverlayPanel implements OnInit,AfterViewInit,OnDestroy {

ngOnInit() {
if(this.dismissable) {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(!this.selfClick&&!this.targetEvent) {
this.hide();
}
Expand Down
2 changes: 1 addition & 1 deletion components/slidemenu/slidemenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class SlideMenu implements AfterViewInit,OnDestroy {
this.slideMenuContentElement.style.height = this.viewportHeight - this.domHandler.getHiddenElementOuterHeight(this.backwardElement) + 'px';

if(this.popup) {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(!this.preventDocumentDefault) {
this.hide();
}
Expand Down
4 changes: 2 additions & 2 deletions components/slider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ export class Slider implements AfterViewInit,OnDestroy,ControlValueAccessor {
return;
}

this.dragListener = this.renderer.listenGlobal('body', 'mousemove', (event) => {
this.dragListener = this.renderer.listenGlobal('document', 'mousemove', (event) => {
if(this.dragging) {
this.handleChange(event);
}
});

this.mouseupListener = this.renderer.listenGlobal('body', 'mouseup', (event) => {
this.mouseupListener = this.renderer.listenGlobal('document', 'mouseup', (event) => {
if(this.dragging) {
this.dragging = false;
this.onSlideEnd.emit({originalEvent: event, value: this.value});
Expand Down
2 changes: 1 addition & 1 deletion components/splitbutton/splitbutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class SplitButton implements OnInit,OnDestroy {
constructor(public el: ElementRef, public domHandler: DomHandler, public renderer: Renderer, public router: Router, public cd: ChangeDetectorRef) {}

ngOnInit() {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
this.menuVisible = false;
this.cd.markForCheck();
});
Expand Down
2 changes: 1 addition & 1 deletion components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class TieredMenu implements AfterViewInit,OnDestroy {
this.container = this.el.nativeElement.children[0];

if(this.popup) {
this.documentClickListener = this.renderer.listenGlobal('body', 'click', () => {
this.documentClickListener = this.renderer.listenGlobal('document', 'click', () => {
if(!this.preventDocumentDefault) {
this.hide();
}
Expand Down

0 comments on commit ae34585

Please sign in to comment.