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

Add line-height to element component which can make use of it

Other elements do implement the interface but do nothing with the 
property. This make all the interface handling a lot easier at the cost 
of having useless variables in some contexts.
parent e0d7dc75
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ import { CheckboxElement } from '../models/checkbox-element'; ...@@ -18,7 +18,7 @@ import { CheckboxElement } from '../models/checkbox-element';
[style.font-weight]="elementModel.bold ? 'bold' : ''" [style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.font-style]="elementModel.italic ? 'italic' : ''" [style.font-style]="elementModel.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''"> [style.text-decoration]="elementModel.underline ? 'underline' : ''">
<div [innerHTML]="elementModel.label"></div> <div [style.line-height.%]="elementModel.lineHeight" [innerHTML]="elementModel.label"></div>
</mat-checkbox> </mat-checkbox>
<mat-error *ngIf="elementFormControl.errors && elementFormControl.touched" <mat-error *ngIf="elementFormControl.errors && elementFormControl.touched"
class="error-message"> class="error-message">
......
...@@ -13,6 +13,7 @@ import { LikertElementRow } from '../../models/compound-elements/likert-element- ...@@ -13,6 +13,7 @@ import { LikertElementRow } from '../../models/compound-elements/likert-element-
[style.color]="elementModel.fontColor" [style.color]="elementModel.fontColor"
[style.font-family]="elementModel.font" [style.font-family]="elementModel.font"
[style.font-size.px]="elementModel.fontSize" [style.font-size.px]="elementModel.fontSize"
[style.line-height.%]="elementModel.lineHeight"
[style.font-weight]="elementModel.bold ? 'bold' : ''" [style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.font-style]="elementModel.italic ? 'italic' : ''" [style.font-style]="elementModel.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''" [style.text-decoration]="elementModel.underline ? 'underline' : ''"
......
...@@ -15,14 +15,16 @@ import { RadioButtonGroupElement } from '../models/radio-button-group-element'; ...@@ -15,14 +15,16 @@ import { RadioButtonGroupElement } from '../models/radio-button-group-element';
[style.font-weight]="elementModel.bold ? 'bold' : ''" [style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.font-style]="elementModel.italic ? 'italic' : ''" [style.font-style]="elementModel.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''"> [style.text-decoration]="elementModel.underline ? 'underline' : ''">
<label [innerHTML]="elementModel.label" <label id="radio-group-label" class="white-space-break"
class="white-space-break" [innerHTML]="elementModel.label">
id="radio-group-label"></label> </label>
<mat-radio-group aria-labelledby="radio-group-label" <mat-radio-group aria-labelledby="radio-group-label"
[style.margin-bottom.px]="25" [style.margin-bottom.px]="25"
[fxLayout]="elementModel.alignment" [fxLayout]="elementModel.alignment"
[formControl]="elementFormControl"> [formControl]="elementFormControl">
<mat-radio-button *ngFor="let option of elementModel.options; let i = index" [value]="i"> <mat-radio-button *ngFor="let option of elementModel.options; let i = index"
[value]="i"
[style.line-height.%]="elementModel.lineHeight">
{{option}} {{option}}
</mat-radio-button> </mat-radio-button>
<mat-error *ngIf="elementFormControl.errors && elementFormControl.touched" <mat-error *ngIf="elementFormControl.errors && elementFormControl.touched"
......
...@@ -21,6 +21,7 @@ import { TextAreaElement } from '../models/text-area-element'; ...@@ -21,6 +21,7 @@ import { TextAreaElement } from '../models/text-area-element';
autocomplete="off" autocomplete="off"
placeholder="{{elementModel.label}}" placeholder="{{elementModel.label}}"
[style.min-width.%]="100" [style.min-width.%]="100"
[style.line-height.%]="elementModel.lineHeight"
[style.resize]="elementModel.resizeEnabled ? 'both' : 'none'"> [style.resize]="elementModel.resizeEnabled ? 'both' : 'none'">
</textarea> </textarea>
<mat-error *ngIf="elementFormControl.errors"> <mat-error *ngIf="elementFormControl.errors">
......
...@@ -31,6 +31,7 @@ import { TextElement } from '../models/text-element'; ...@@ -31,6 +31,7 @@ import { TextElement } from '../models/text-element';
<div [style.background-color]="elementModel.backgroundColor" <div [style.background-color]="elementModel.backgroundColor"
[style.color]="elementModel.fontColor" [style.color]="elementModel.fontColor"
[style.font-family]="elementModel.font" [style.font-family]="elementModel.font"
[style.line-height.%]="elementModel.lineHeight"
[style.font-weight]="elementModel.bold ? 'bold' : ''" [style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.font-style]="elementModel.italic ? 'italic' : ''" [style.font-style]="elementModel.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''" [style.text-decoration]="elementModel.underline ? 'underline' : ''"
......
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