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

[editor] Fix style property inputs when value is set to empty string

The whole panel tab was not correctly checking for value existence. Need 
to check for undefined not null.
parent 7c3422c6
No related branches found
No related tags found
No related merge requests found
......@@ -7,31 +7,31 @@ import { UIElement } from '../../../../../../common/models/uI-element';
selector: 'app-element-style-properties',
template: `
<div fxLayout="column">
<mat-form-field *ngIf="combinedProperties.backgroundColor"
<mat-form-field *ngIf="combinedProperties.backgroundColor !== undefined"
appearance="fill" class="mdInput textsingleline">
<mat-label>{{'propertiesPanel.backgroundColor' | translate }}</mat-label>
<input matInput type="color" [value]="combinedProperties.backgroundColor"
(input)="updateModel.emit({ property: 'backgroundColor', value: $any($event.target).value })">
</mat-form-field>
<mat-form-field *ngIf="combinedProperties.backgroundColor"
<mat-form-field *ngIf="combinedProperties.backgroundColor !== undefined"
appearance="fill" class="mdInput textsingleline">
<mat-label>{{'propertiesPanel.backgroundColor' | translate }}</mat-label>
<input matInput type="text" [value]="combinedProperties.backgroundColor"
(input)="updateModel.emit({ property: 'backgroundColor', value: $any($event.target).value })">
</mat-form-field>
<mat-form-field *ngIf="combinedProperties.fontColor"
<mat-form-field *ngIf="combinedProperties.fontColor !== undefined"
appearance="fill" class="mdInput textsingleline">
<mat-label>{{'propertiesPanel.fontColor' | translate }}</mat-label>
<input matInput type="color" [value]="combinedProperties.fontColor"
(input)="updateModel.emit({ property: 'fontColor', value: $any($event.target).value })">
</mat-form-field>
<mat-form-field *ngIf="combinedProperties.font != null"
<mat-form-field *ngIf="combinedProperties.font !== undefined"
appearance="fill" class="mdInput textsingleline">
<mat-label>{{'propertiesPanel.font' | translate }}</mat-label>
<input matInput type="text" [value]="combinedProperties.font"
(input)="updateModel.emit({ property: 'font', value: $any($event.target).value })">
</mat-form-field>
<mat-form-field *ngIf="combinedProperties.fontSize != null"
<mat-form-field *ngIf="combinedProperties.fontSize !== undefined"
appearance="fill" class="mdInput textsingleline">
<mat-label>{{'propertiesPanel.fontSize' | translate }}</mat-label>
<input matInput type="number" #fontSize="ngModel" min="0"
......@@ -40,7 +40,7 @@ import { UIElement } from '../../../../../../common/models/uI-element';
value: $event,
isInputValid: fontSize.valid && $event !== null})">
</mat-form-field>
<mat-form-field *ngIf="combinedProperties.lineHeight != null"
<mat-form-field *ngIf="combinedProperties.lineHeight !== undefined"
appearance="fill" class="mdInput textsingleline">
<mat-label>{{'propertiesPanel.lineHeight' | translate }}</mat-label>
<input matInput type="number" #lineHeight="ngModel" min="0"
......@@ -50,17 +50,17 @@ import { UIElement } from '../../../../../../common/models/uI-element';
isInputValid: lineHeight.valid && $event !== null })">
</mat-form-field>
<mat-checkbox *ngIf="combinedProperties.bold != null"
<mat-checkbox *ngIf="combinedProperties.bold !== undefined"
[checked]="$any(combinedProperties.bold)"
(change)="updateModel.emit({ property: 'bold', value: $event.checked })">
{{'propertiesPanel.bold' | translate }}
</mat-checkbox>
<mat-checkbox *ngIf="combinedProperties.italic != null"
<mat-checkbox *ngIf="combinedProperties.italic !== undefined"
[checked]="$any(combinedProperties.italic)"
(change)="updateModel.emit({ property: 'italic', value: $event.checked })">
{{'propertiesPanel.italic' | translate }}
</mat-checkbox>
<mat-checkbox *ngIf="combinedProperties.underline != null"
<mat-checkbox *ngIf="combinedProperties.underline !== undefined"
[checked]="$any(combinedProperties.underline)"
(change)="updateModel.emit({ property: 'underline', value: $event.checked })">
{{'propertiesPanel.underline' | translate }}
......
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