From 4a9fe00d5ac262e8cfafa09c5dffcb3ee0312552 Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Wed, 7 Jul 2021 13:17:53 +0200 Subject: [PATCH] [player] Rework the appearance of `sections` * Use all style attributes of the unit definition to display sections * Remove unnecessary div tag from `SectionComponent` --- projects/player/src/app/page.component.ts | 5 +++-- projects/player/src/app/section.component.ts | 9 ++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/projects/player/src/app/page.component.ts b/projects/player/src/app/page.component.ts index 379158b82..730e88525 100644 --- a/projects/player/src/app/page.component.ts +++ b/projects/player/src/app/page.component.ts @@ -7,10 +7,11 @@ import { UnitPage } from '../../../common/unit'; <app-section *ngFor="let section of page.sections; let i = index" [section]="section" [ngStyle]="{ - width: '100%', position: 'relative', display: 'inline-block', - 'height.px': section.height }"> + 'background-color': section.backgroundColor, + 'height.px': section.height, + 'width.px': section.width }"> {{section.height}} </app-section> ` diff --git a/projects/player/src/app/section.component.ts b/projects/player/src/app/section.component.ts index 2362c6912..388ef202e 100644 --- a/projects/player/src/app/section.component.ts +++ b/projects/player/src/app/section.component.ts @@ -7,13 +7,8 @@ import * as ComponentUtils from '../../../common/component-utils'; @Component({ selector: 'app-section', template: ` - <div fxLayout="column"> - <ng-template #elementContainer></ng-template> - </div> - `, - styles: [ - 'div {position: absolute}' - ] + <ng-template #elementContainer></ng-template> + ` }) export class SectionComponent implements OnInit { @Input() section!: UnitPageSection; -- GitLab