[ACA] contextmenu - document click event breaks implementation in FF (#593)

* listen event from body element

* add event parameter
This commit is contained in:
Cilibiu Bogdan
2018-08-31 20:07:18 +03:00
committed by Denys Vuika
parent 08917e862c
commit d607618920
2 changed files with 3 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ export class OutsideEventDirective implements OnInit, OnDestroy {
ngOnInit() {
this.subscriptions = this.subscriptions.concat([
fromEvent(document, 'click')
fromEvent(document.body, 'click')
.pipe(delay(1))
.subscribe(() => this.clickOutside.next())
]);

View File

@@ -68,7 +68,7 @@ export class ContextActionsDirective {
) { }
private execute(event: MouseEvent) {
const selected = this.getSelectedRow();
const selected = this.getSelectedRow(event);
if (selected) {
if (!this.isInSelection(selected)) {
@@ -108,7 +108,7 @@ export class ContextActionsDirective {
row.getValue('name') === selected.entry.name);
}
private getSelectedRow(): DataRow {
private getSelectedRow(event): DataRow {
const rowElement = this.findAncestor(<HTMLElement>event.target, 'adf-datatable-row');
if (!rowElement) {