diff --git a/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html index 63002d513..7317dccec 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/screen/dossier-overview-screen.component.html @@ -56,7 +56,7 @@ -
+
{{ 'file-preview.tabs.annotations.the-filters' | translate }} - } @else if (state.componentReferenceIds?.length === 0) { + } @else if (state.componentReferenceIds()?.length === 0) { {{ 'file-preview.tabs.annotations.no-annotations' | translate }} } } diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html index 25a712301..8a8a8057c 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html @@ -3,7 +3,7 @@
-
+
@if (isDocumine) { -
+
} -
('resize'); - readonly container = viewChild('container'); - drag = false; - moveX = 0; protected readonly isDocumine = getConfig().IS_DOCUMINE; @ViewChild('annotationFilterTemplate', { read: TemplateRef, @@ -242,28 +237,30 @@ export class FilePreviewScreenComponent ); } - @Bind() - mouseDown(event: MouseEvent) { + onDragStart(event: CdkDragStart) { + event.event.preventDefault(); if (!this.isDocumine) return; - this.drag = true; + const contentInnerElement = document.body.getElementsByClassName('content-inner').item(0) as HTMLElement; + if (contentInnerElement) { + contentInnerElement.classList.add('dragging'); + } } - @Bind() - mouseMove(event: MouseEvent) { + onDragMove(event: CdkDragMove) { if (!this.isDocumine) return; - if (!this.drag) return; - if (this.#getPixelsInPercentage(event.screenX) <= this.#getPixelsInPercentage(250)) return; - this.moveX = event.screenX; - const newLeftWidth = this.#convertPixelsToPercent(this.moveX - this.resizeHandle().nativeElement.getBoundingClientRect().width / 2); - + const e = event.event as MouseEvent; + const newLeftWidth = `${this.#getPixelsInPercentage(e.clientX - this.resizeHandle().nativeElement.style.width / 2)}%`; document.body.style.setProperty('--structured-component-management-width', newLeftWidth); - event.preventDefault(); + this.resizeHandle().nativeElement.style.transform = 'none'; } - @Bind() - mouseUp(event: MouseEvent) { + onDragEnd(event: CdkDragEnd) { + event.event.preventDefault(); if (!this.isDocumine) return; - this.drag = false; + const contentInnerElement = document.body.getElementsByClassName('content-inner').item(0) as HTMLElement; + if (contentInnerElement) { + contentInnerElement.classList.remove('dragging'); + } } deleteEarmarksOnViewChange$() { @@ -289,24 +286,12 @@ export class FilePreviewScreenComponent super.ngOnDetach(); this.pdf.instance.UI.hotkeys.off('esc'); this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick); - this.resizeHandle().nativeElement.removeEventListener('mousedown', this.mouseDown); - this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousedown', this.mouseDown); - this.container().nativeElement.removeEventListener('mousemove', this.mouseMove); - this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousemove', this.mouseMove); - this.container().nativeElement.removeEventListener('mouseup', this.mouseUp); - this.pdf.instance.UI.iframeWindow.document.removeEventListener('mouseup', this.mouseUp); this._changeRef.markForCheck(); } ngOnDestroy() { this.pdf.instance.UI.hotkeys.off('esc'); this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick); - this.resizeHandle().nativeElement.removeEventListener('mousedown', this.mouseDown); - this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousedown', this.mouseDown); - this.container().nativeElement.removeEventListener('mousemove', this.mouseMove); - this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousemove', this.mouseMove); - this.container().nativeElement.removeEventListener('mouseup', this.mouseUp); - this.pdf.instance.UI.iframeWindow.document.removeEventListener('mouseup', this.mouseUp); super.ngOnDestroy(); } @@ -390,15 +375,6 @@ export class FilePreviewScreenComponent this.pdf.instance.UI.iframeWindow.document.addEventListener('click', this.handleViewerClick); } - ngAfterViewInit() { - this.resizeHandle().nativeElement.addEventListener('mousedown', this.mouseDown); - this.pdf.instance.UI.iframeWindow.document.addEventListener('mousedown', this.mouseDown); - this.container().nativeElement.addEventListener('mousemove', this.mouseMove); - this.pdf.instance.UI.iframeWindow.document.addEventListener('mousemove', this.mouseMove); - this.container().nativeElement.addEventListener('mouseup', this.mouseUp); - this.pdf.instance.UI.iframeWindow.document.addEventListener('mouseup', this.mouseUp); - } - async openRectangleAnnotationDialog(manualRedactionEntryWrapper: ManualRedactionEntryWrapper) { const file = this.state.file(); @@ -475,11 +451,7 @@ export class FilePreviewScreenComponent } #getPixelsInPercentage(pixels: number) { - return Math.round((100 - ((window.screen.width - pixels) / window.screen.width) * 100 + Number.EPSILON) * 100) / 100; - } - - #convertPixelsToPercent(pixels: number) { - return `${this.#getPixelsInPercentage(pixels)}%`; + return (pixels / window.screen.width) * 100; } async #updateViewMode(): Promise { diff --git a/libs/common-ui b/libs/common-ui index ae0eebcc6..72e760fff 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit ae0eebcc6feceba4fe5c930d79eadd9b9a60b7e9 +Subproject commit 72e760fff8bc1adb72969b1e6e6971cdb88d55fe