RED-9944 - cancel the bulk-selection mode when a user clicks somewhere else

This commit is contained in:
Valentin Mihai 2024-10-16 23:12:09 +03:00
parent 26e8d9fff9
commit c8c632a2c1
2 changed files with 23 additions and 0 deletions

View File

@ -522,4 +522,16 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On
});
return listItemsMap;
}
@HostListener('click', ['$event'])
clickInsideWorkloadView($event: MouseEvent) {
$event?.stopPropagation();
}
@HostListener('document: click')
clickOutsideWorkloadView() {
if (this.multiSelectService.active()) {
this.multiSelectService.deactivate();
}
}
}

View File

@ -307,6 +307,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
ngOnDestroy() {
this.pdf.instance.UI.hotkeys.off('esc');
this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick);
super.ngOnDestroy();
}
@ -331,6 +332,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
}
}
@Bind()
handleViewerClick() {
this._ngZone.run(() => {
if (this._multiSelectService.active()) {
this._multiSelectService.deactivate();
}
});
}
async ngOnAttach(previousRoute: ActivatedRouteSnapshot) {
if (!this.state.file().canBeOpened) {
return this.#navigateToDossier();
@ -361,6 +371,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
this.#restoreOldFilters();
this.pdf.instance.UI.hotkeys.on('esc', this.handleEscInsideViewer);
this._viewerHeaderService.resetLayers();
this.pdf.instance.UI.iframeWindow.document.addEventListener('click', this.handleViewerClick);
}
openManualAnnotationDialog(manualRedactionEntryWrapper: ManualRedactionEntryWrapper) {