Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #7783 - The "showProgressBar": "belowHeader" setting doesn't work #7790

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6058,7 +6058,7 @@ export class SurveyModel extends SurveyElementCore
}
startLoadingFromJson(json?: any): void {
super.startLoadingFromJson(json);
if(json && json.locale) {
if (json && json.locale) {
this.locale = json.locale;
}
}
Expand Down Expand Up @@ -7490,6 +7490,9 @@ export class SurveyModel extends SurveyElementCore
if (isStrCiEqual(this.showProgressBar, "aboveHeader")) {
isBelowHeader = false;
}
if (isStrCiEqual(this.showProgressBar, "belowHeader")) {
isBelowHeader = true;
}
if (container === "header" && !isBelowHeader) {
layoutElement.index = -150;
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
Expand Down
17 changes: 16 additions & 1 deletion tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18778,11 +18778,26 @@ QUnit.test("getContainerContent - progress + advanced header (legacyProgressBarV
assert.deepEqual(getContainerContent("left"), [], "progress top left");
assert.deepEqual(getContainerContent("right"), [], "progress top right");

survey.showProgressBar = "belowHeader";
assert.deepEqual(getContainerContent("header"), [{
"component": "sv-header",
"container": "header",
"id": "advanced-header",
"index": -100
}], "progress top header");
assert.deepEqual(getContainerContent("center"), [{
"component": "sv-progress-pages",
"id": "progress-pages",
}], "progress top center");
assert.deepEqual(getContainerContent("footer"), [], "progress top footer");
assert.deepEqual(getContainerContent("contentTop"), [], "progress top contentTop");
assert.deepEqual(getContainerContent("contentBottom"), [], "progress top contentBottom");
assert.deepEqual(getContainerContent("left"), [], "progress top left");
assert.deepEqual(getContainerContent("right"), [], "progress top right");
}
finally {
settings.legacyProgressBarView = false;
}

});

QUnit.test("getContainerContent - progress + advanced header", function (assert) {
Expand Down
Loading