Skip to content
Snippets Groups Projects
Commit 494162eb authored by jojohoch's avatar jojohoch
Browse files

Refactor setting of the default z-index

parent bf598c5a
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,14 @@ export class FrameElement extends UIElement implements PositionedElement, Surfac
constructor(serializedElement: Partial<UIElement>) {
super(serializedElement);
Object.assign(this, serializedElement);
if (serializedElement.positionProps && serializedElement.positionProps.zIndex === undefined) {
serializedElement.positionProps.zIndex = -1;
const newSerializedElement = serializedElement;
if (newSerializedElement.positionProps && newSerializedElement.positionProps.zIndex === undefined) {
newSerializedElement.positionProps.zIndex = -1;
}
this.positionProps = initPositionedElement(serializedElement);
this.surfaceProps = initSurfaceElement(serializedElement);
this.positionProps = initPositionedElement(newSerializedElement);
this.surfaceProps = initSurfaceElement(newSerializedElement);
this.surfaceProps.backgroundColor =
serializedElement.surfaceProps?.backgroundColor as string ||
newSerializedElement.surfaceProps?.backgroundColor as string ||
'transparent';
}
}
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