Skip to content

Commit

Permalink
work for #6655 rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Sep 4, 2023
1 parent 93becbd commit 48f007c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/defaultCss/defaultV2Css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export var defaultV2Css = {
rootWrapperFixed: "sd-root-modern__wrapper--fixed",
rootBackgroundImage: "sd-root_background-image",
rootBackgroundImageFixed: "sd-root_background-image--fixed",
rootForm: "sd-root_form",
container: "sd-container-modern",
header: "sd-title sd-container-modern__title",
bodyContainer: "sv-components-row",
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@
left: 0;
right: 0;
}
.sd-root-modern--full-container .sd-root_background-image.sd-root_background-image--fixed {
.sd-root-modern--full-container.sd-root-modern__wrapper--fixed .sd-root_background-image {
right: 12px;
}
4 changes: 2 additions & 2 deletions src/knockout/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<div data-bind="css: rootCss, elementStyle: themeVariables">
<div data-bind="css: wrapperFormCss">
<!-- ko if: !!renderBackgroundImage -->
<div data-bind="css: backgroundImageCss, elementStyle: backgroundImageStyle"></div>
<div data-bind="css: css.rootBackgroundImage, elementStyle: backgroundImageStyle"></div>
<!-- /ko -->
<form data-bind="css: css.rootForm" onsubmit="return false;">
<form onsubmit="return false;">
<div class="sv_custom_header" data-bind="visible: !hasLogo"></div>
<div data-bind="css: containerCss">
<!-- ko template: { name: koTitleTemplate, afterRender: koAfterRenderHeader } -->
Expand Down
4 changes: 2 additions & 2 deletions src/react/reactSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class Survey extends SurveyElementBase<any, any>
} else {
renderResult = this.renderSurvey();
}
const backgroundImage = !!this.survey.backgroundImage ? <div className={this.survey.backgroundImageCss} style={this.survey.backgroundImageStyle}></div> : null;
const backgroundImage = !!this.survey.backgroundImage ? <div className={this.css.rootBackgroundImage} style={this.survey.backgroundImageStyle}></div> : null;
const header: JSX.Element = <SurveyHeader survey={this.survey}></SurveyHeader>;
const onSubmit = function (event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
Expand All @@ -111,7 +111,7 @@ export class Survey extends SurveyElementBase<any, any>
<div id={this.rootNodeId} ref={this.rootRef} className={cssClasses} style={this.survey.themeVariables}>
<div className={this.survey.wrapperFormCss}>
{!!backgroundImage ? backgroundImage: null}
<form className={this.css.rootForm} onSubmit={onSubmit}>
<form onSubmit={onSubmit}>
{customHeader}
<div className={this.css.container}>
{header}
Expand Down
8 changes: 0 additions & 8 deletions src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,6 @@ export class SurveyModel extends SurveyElementCore
this.rootCss = this.getRootCss();
this.updateNavigationCss();
this.updateCompletedPageCss();
this.updateBackgroundImageCss();
this.updateWrapperFormCss();
}
/**
Expand Down Expand Up @@ -2098,13 +2097,6 @@ export class SurveyModel extends SurveyElementCore
backgroundAttachment: !this.fitToContainer ? this.backgroundImageAttachment : undefined
};
}
@property() backgroundImageCss: string;
public updateBackgroundImageCss(): void {
this.backgroundImageCss = new CssClassBuilder()
.append(this.css.rootBackgroundImage)
.append(this.css.rootBackgroundImageFixed, this.backgroundImageFixed)
.toString();
}
@property() wrapperFormCss: string;
public updateWrapperFormCss(): void {
this.wrapperFormCss = new CssClassBuilder()
Expand Down

0 comments on commit 48f007c

Please sign in to comment.