Skip to content
Snippets Groups Projects
Commit 46a34283 authored by rhenck's avatar rhenck
Browse files

Remove useless CompoundElement component wrapper-element and CSS rules

- Extra span element around cloze child elements served no visible 
purpose. It also makes sense that an inline div is not inside of a span, 
which is meant for text.
- CSS rules were overengineered and in part shadowed (and thereby 
pointless) by element styles from the template.
This is also in preparation for the DropList styling overhaul.
parent acd3c1a7
No related branches found
No related tags found
No related merge requests found
...@@ -155,14 +155,14 @@ import { ClozeElement } from 'common/models/elements/compound-elements/cloze/clo ...@@ -155,14 +155,14 @@ import { ClozeElement } from 'common/models/elements/compound-elements/cloze/clo
[style.height]="'1em'" [style.height]="'1em'"
[style.vertical-align]="'middle'"> [style.vertical-align]="'middle'">
</ng-container> </ng-container>
<span *ngIf="['ToggleButton', 'DropList', 'TextField', 'Button'] | arrayIncludes:subPart.type"> <aspect-compound-child-overlay
<aspect-compound-child-overlay [style.display]="'inline-block'" *ngIf="['ToggleButton', 'DropList', 'TextField', 'Button'] | arrayIncludes:subPart.type"
[parentForm]="parentForm" [style.display]="'inline-block'"
[element]="$any(subPart).attrs.model" [parentForm]="parentForm"
[editorMode]="editorMode" [element]="$any(subPart).attrs.model"
(elementSelected)="childElementSelected.emit($event)"> [editorMode]="editorMode"
</aspect-compound-child-overlay> (elementSelected)="childElementSelected.emit($event)">
</span> </aspect-compound-child-overlay>
</ng-container> </ng-container>
</ng-template> </ng-template>
`, `,
......
...@@ -44,11 +44,8 @@ import { ValueChangeElement } from 'common/models/elements/element'; ...@@ -44,11 +44,8 @@ import { ValueChangeElement } from 'common/models/elements/element';
</div> </div>
`, `,
styles: [ styles: [
':host {vertical-align: middle;}', ':host div > * {display: inline-block;}',
':host > div {border-radius: 3px;}', 'aspect-drop-list {vertical-align: middle;}'
':host div > * {display: inline-block; padding-bottom: 2px; box-sizing: border-box;}',
'aspect-drop-list, aspect-text-field-simple {width: 100%; height: 100%;}',
'aspect-drop-list {line-height: unset; vertical-align: top;}'
] ]
}) })
export class CompoundChildOverlayComponent { // TODO rename to ClozeChildOverlay export class CompoundChildOverlayComponent { // TODO rename to ClozeChildOverlay
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment