From 676ef1230d8c879e95b18e283218c3cd95e9da8f Mon Sep 17 00:00:00 2001 From: rhenck <richard.henck@iqb.hu-berlin.de> Date: Mon, 19 Jul 2021 16:41:35 +0200 Subject: [PATCH] [editor] Refactor variable from useless setter to normal --- .../page-view/canvas/canvas-drag-overlay.component.ts | 4 ++-- .../unit-view/page-view/canvas/canvas-section.component.ts | 4 ++-- .../unit-view/page-view/canvas/page-canvas.component.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-drag-overlay.component.ts b/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-drag-overlay.component.ts index 9acbd36bb..dae87a565 100644 --- a/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-drag-overlay.component.ts +++ b/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-drag-overlay.component.ts @@ -66,8 +66,8 @@ export class CanvasDragOverlayComponent implements OnInit { childComponent.location.nativeElement.firstChild.style.cursor = 'inherit'; } - set selected(newValue: boolean) { - this._selected = newValue; + setSelected(newValue: boolean): void { + this.selected = newValue; } click(event: MouseEvent): void { diff --git a/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-section.component.ts b/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-section.component.ts index 04777235a..7573cd0af 100644 --- a/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-section.component.ts +++ b/projects/editor/src/app/components/unit-view/page-view/canvas/canvas-section.component.ts @@ -38,7 +38,7 @@ export class CanvasSectionComponent implements OnInit { this.canvasComponents.forEach((component: CanvasDragOverlayComponent) => { selectedElements.forEach((selectedElement: UnitUIElement) => { if (component.element === selectedElement) { - component.selected = true; + component.setSelected(true); } }); }); @@ -46,7 +46,7 @@ export class CanvasSectionComponent implements OnInit { clearSelection(): void { this.canvasComponents.forEach((canvasComponent: CanvasDragOverlayComponent) => { - canvasComponent.selected = false; + canvasComponent.setSelected(false); }); } diff --git a/projects/editor/src/app/components/unit-view/page-view/canvas/page-canvas.component.ts b/projects/editor/src/app/components/unit-view/page-view/canvas/page-canvas.component.ts index fc0449b94..aa4fc55a9 100644 --- a/projects/editor/src/app/components/unit-view/page-view/canvas/page-canvas.component.ts +++ b/projects/editor/src/app/components/unit-view/page-view/canvas/page-canvas.component.ts @@ -69,7 +69,7 @@ export class PageCanvasComponent implements OnInit, OnDestroy { } this.selectedComponentElements.push(event.componentElement); this.unitService.selectElement(event.componentElement.element); - event.componentElement.selected = true; + event.componentElement.setSelected(true); } private clearSelection() { -- GitLab