diff --git a/projects/common/models/slider-element.ts b/projects/common/models/slider-element.ts index 9d201c038694a18818eb79b0a054a5a2f13678d4..78f74e3e395de84621346951bdf99c74f483a349 100644 --- a/projects/common/models/slider-element.ts +++ b/projects/common/models/slider-element.ts @@ -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'; } } diff --git a/projects/common/util/element.factory.ts b/projects/common/util/element.factory.ts index 8195801f66ea8ef64d3ae62f7cd3eb2bce01fcf1..009fed16f29ef896dafb503db4b890630f177395 100644 --- a/projects/common/util/element.factory.ts +++ b/projects/common/util/element.factory.ts @@ -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;