Skip to content
Snippets Groups Projects
Commit feba9924 authored by mechtelm's avatar mechtelm
Browse files

Add defaults for background, width and height

parent 08d663f9
No related branches found
No related tags found
No related merge requests found
......@@ -26,10 +26,10 @@ export class SliderElement extends InputElement implements FontElement, SurfaceU
registerLocaleData(localeDe);
Object.assign(this, serializedElement);
Object.assign(this, initFontElement(serializedElement));
if (!serializedElement.backgroundColor) {
serializedElement.backgroundColor = '#d3d3d300';
}
Object.assign(this, initSurfaceElement(serializedElement));
// todo: delete this.label --> label must be declared as optional
this.height = serializedElement.height || 70;
this.width = serializedElement.width || 300;
this.backgroundColor = serializedElement.backgroundColor as string || '#d3d3d300';
}
}
......@@ -10,7 +10,6 @@ import { RadioButtonGroupElement } from '../models/radio-button-group-element';
import { ImageElement } from '../models/image-element';
import { AudioElement } from '../models/audio-element';
import { VideoElement } from '../models/video-element';
import { FileService } from '../file.service';
import { TextComponent } from '../element-components/text.component';
import { ButtonComponent } from '../element-components/button.component';
import { TextFieldComponent } from '../element-components/text-field.component';
......@@ -28,7 +27,7 @@ import { RadioGroupImagesElement } from '../models/compound-elements/radio-group
import { DropListComponent } from '../element-components/compound-elements/drop-list.component';
import { DropListElement } from '../models/compound-elements/drop-list';
import { SliderElement } from '../models/slider-element';
import {SliderComponent} from "../element-components/slider.component";
import { SliderComponent } from '../element-components/slider.component';
export function createElement(elementModel: UIElement): UIElement {
let newElement: UIElement;
......
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