diff --git a/projects/editor/src/app/components/canvas/canvas.component.html b/projects/editor/src/app/components/canvas/canvas.component.html index a3cc4691fa36d2105fc2334da974afe2e0349917..83918eca7e1f91b10371f4fae5bd630615f4a953 100644 --- a/projects/editor/src/app/components/canvas/canvas.component.html +++ b/projects/editor/src/app/components/canvas/canvas.component.html @@ -5,7 +5,7 @@ [style.background-color]="page.backgroundColor"> <div cdkDropListGroup> <div *ngFor="let section of page.sections; let i = index" [style.position]="'relative'"> - <aspect-section-menu [class.hidden]="selectionService.selectedPageSectionIndex !== i" + <aspect-section-menu [class.hidden]="selectionService.selectedSectionIndex !== i" class="section-menu fx-column-start-stretch" [style.left.px]="-45" [style.z-index]="1" [style.position]="'absolute'" [section]="section" [sectionIndex]="i" @@ -20,23 +20,23 @@ #sectionComponent class="section drop-list" id="section-{{i}}" [section]="section" - [isSelected]="selectionService.selectedPageSectionIndex === i" - (elementSelected)="selectionService.selectedPageSectionIndex = i" + [isSelected]="selectionService.selectedSectionIndex === i" + (elementSelected)="selectionService.selectedSectionIndex = i" cdkDropList cdkDropListSortingDisabled [cdkDropListData]="{ sectionIndex: i }" (cdkDropListDropped)="elementDropped($event)" - (click)="selectionService.selectedPageSectionIndex = i"> + (click)="selectionService.selectedSectionIndex = i"> </aspect-section-static> <aspect-section-dynamic *ngIf="section.dynamicPositioning" #sectionComponent class="section drop-list" [section]="section" [sectionIndex]="i" - [isSelected]="selectionService.selectedPageSectionIndex === i" - (elementSelected)="selectionService.selectedPageSectionIndex = i" + [isSelected]="selectionService.selectedSectionIndex === i" + (elementSelected)="selectionService.selectedSectionIndex = i" (transferElement)="moveElementsBetweenSections(selectionService.getSelectedElements(), $event.previousSectionIndex, $event.newSectionIndex)" - (click)="selectionService.selectedPageSectionIndex = i"> + (click)="selectionService.selectedSectionIndex = i"> </aspect-section-dynamic> </div> </div> diff --git a/projects/editor/src/app/components/canvas/canvas.component.ts b/projects/editor/src/app/components/canvas/canvas.component.ts index a2f687ebb68671ddbdde6121563d212a56a60ff3..6bdfe223797dbecb9170147fcbfbd1ee4896fada 100644 --- a/projects/editor/src/app/components/canvas/canvas.component.ts +++ b/projects/editor/src/app/components/canvas/canvas.component.ts @@ -92,7 +92,7 @@ export class CanvasComponent { addSection(): void { this.sectionService.addSection(this.page); - this.selectionService.selectedPageSectionIndex = this.page.sections.length - 1; + this.selectionService.selectedSectionIndex = this.page.sections.length - 1; } selectElementOverlay(element: UIElement): void { diff --git a/projects/editor/src/app/components/canvas/section-menu.component.ts b/projects/editor/src/app/components/canvas/section-menu.component.ts index 3f84e88649d2f512556ee0e9c0885052d945f872..4a904ea5c7144b09ee84492f083dd3c10864b8cc 100644 --- a/projects/editor/src/app/components/canvas/section-menu.component.ts +++ b/projects/editor/src/app/components/canvas/section-menu.component.ts @@ -212,8 +212,8 @@ export class SectionMenuComponent implements OnDestroy { if (result) { ReferenceManager.deleteReferences(refs); this.sectionService.deleteSection(this.selectionService.selectedPageIndex, this.sectionIndex); - this.selectionService.selectedPageSectionIndex = - Math.max(0, this.selectionService.selectedPageSectionIndex - 1); + this.selectionService.selectedSectionIndex = + Math.max(0, this.selectionService.selectedSectionIndex - 1); } else { this.messageService.showReferencePanel(refs); } @@ -224,8 +224,8 @@ export class SectionMenuComponent implements OnDestroy { .subscribe((result: boolean) => { if (result) { this.sectionService.deleteSection(this.selectionService.selectedPageIndex, this.sectionIndex); - this.selectionService.selectedPageSectionIndex = - Math.max(0, this.selectionService.selectedPageSectionIndex - 1); + this.selectionService.selectedSectionIndex = + Math.max(0, this.selectionService.selectedSectionIndex - 1); } }); } diff --git a/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/dimension-field-set.component.ts b/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/dimension-field-set.component.ts index 69889b6965cef53e411770675b183df6952efc57..63736bce2a88350655433f6e69664f5448362e68 100644 --- a/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/dimension-field-set.component.ts +++ b/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/dimension-field-set.component.ts @@ -10,7 +10,7 @@ import { ElementService } from 'editor/src/app/services/unit-services/element.se <fieldset> <legend>Dimensionen</legend> <ng-container *ngIf="unitService.unit.pages[selectionService.selectedPageIndex] - .sections[selectionService.selectedPageSectionIndex].dynamicPositioning || + .sections[selectionService.selectedSectionIndex].dynamicPositioning || selectionService.isClozeChildSelected; else elseBlock"> <mat-checkbox #fixedWidth [checked]="$any(dimensions.isWidthFixed)" diff --git a/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/position-field-set.component.ts b/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/position-field-set.component.ts index 40fc4153d33dcda81452710283e80679a1db40bc..dce82e0d427e161b7977661bfef4156fa89c824c 100644 --- a/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/position-field-set.component.ts +++ b/projects/editor/src/app/components/properties-panel/position-properties-tab/input-groups/position-field-set.component.ts @@ -13,7 +13,7 @@ import { UnitService } from 'editor/src/app/services/unit-services/unit.service' <legend>Position</legend> <div *ngIf="!unitService.unit .pages[selectionService.selectedPageIndex] - .sections[selectionService.selectedPageSectionIndex] + .sections[selectionService.selectedSectionIndex] .dynamicPositioning; else elseBlock" class="flex-row"> diff --git a/projects/editor/src/app/services/selection.service.ts b/projects/editor/src/app/services/selection.service.ts index 77e6d65667d4e6e02108a324212a65a8a4fcd5c1..3fa6afc0da00291085066b9be70d982d6b6830b0 100644 --- a/projects/editor/src/app/services/selection.service.ts +++ b/projects/editor/src/app/services/selection.service.ts @@ -11,7 +11,7 @@ import { }) export class SelectionService { selectedPageIndex: number = 0; - selectedPageSectionIndex: number = 0; + selectedSectionIndex: number = 0; private _selectedElements!: BehaviorSubject<UIElement[]>; selectedElementComponents: (CanvasElementOverlay | ClozeChildOverlay)[] = []; isClozeChildSelected: boolean = false; @@ -49,7 +49,7 @@ export class SelectionService { selectPage(index: number) { this.clearElementSelection(); this.selectedPageIndex = index; - this.selectedPageSectionIndex = 0; + this.selectedSectionIndex = 0; } selectPreviousPage() {