From 819849741b8ed26b9c3c373bf3100e2c2310af85 Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Fri, 16 Dec 2022 13:50:41 +0100 Subject: [PATCH] [player] Center only drop list elements in cloze texts Drop lists that allow only one element but are not used in cloze texts display their elements right-aligned --- .../components/input-elements/drop-list.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/common/components/input-elements/drop-list.component.ts b/projects/common/components/input-elements/drop-list.component.ts index 7c9f07a59..4a67442a1 100644 --- a/projects/common/components/input-elements/drop-list.component.ts +++ b/projects/common/components/input-elements/drop-list.component.ts @@ -44,7 +44,7 @@ import { FormElementComponent } from '../../directives/form-element-component.di <div *ngIf="!dropListValueElement.imgSrc" class="list-item" fxLayout="row" - [fxLayoutAlign]="elementModel.onlyOneItem ? 'center center' : 'none'" + [fxLayoutAlign]="elementModel.onlyOneItem ? (clozeContext ? 'center center' : 'start center') : 'none'" draggable="true" (dragstart)="dragStart($event, dropListValueElement, index)" (dragend)="dragEnd($event)" (dragenter)="dragEnterItem($event)" @@ -76,9 +76,10 @@ import { FormElementComponent } from '../../directives/form-element-component.di '.list {padding: 2px;}', '.list-item {border-radius: 5px;}', ':not(.cloze-context) .list-item {padding: 10px;}', - '.cloze-context .list-item {padding: 0 5px; text-align: center; line-height: 1.2;}', - '.only-one-item .list-item {padding: 0 !important; line-height: 1.2; text-align: center;}', - '.only-one-item .list-item {height: 100%; min-height: 100%; min-width: 100%; width: 100%;}', + '.cloze-context .list-item {padding: 0 5px; line-height: 1.2;}', + '.only-one-item.cloze-context .list-item {padding: 0;}', + '.only-one-item:not(.cloze-context) .list-item {padding: 0 10px;}', + '.only-one-item .list-item {height: 100%; min-height: 100%; min-width: 100%; width: 100%; line-height: 1.2;}', 'img.list-item {align-self: start; padding: 2px !important;}', '.vertical-orientation .list-item:not(:last-child) {margin-bottom: 5px;}', '.horizontal-orientation .list-item:not(:last-child) {margin-right: 5px;}', -- GitLab