From 985e84d57e66357e19dd85a3834f09938aed792b Mon Sep 17 00:00:00 2001 From: Arjen Date: Thu, 18 Apr 2024 15:58:57 +0200 Subject: [PATCH] Fix #12238: Making the question and header sticky in the question editor modal (#20127) * Adds changes made by rassa328 * Improved naming, removed unnecessary code, param is now required * Fixed linting issues * Param specified everywhere, bool value now inline html --- .../question-editor.component.html | 3 +- .../question-editor.component.ts | 1 + .../questions-list.component.html | 3 +- .../state-editor/state-editor.component.html | 8 ++- .../state-editor/state-editor.component.ts | 1 + ...ion-suggestion-editor-modal.component.html | 3 +- .../question-suggestion-review.component.html | 68 ++++++++++++------- .../exploration-editor-tab.component.html | 1 + 8 files changed, 58 insertions(+), 30 deletions(-) diff --git a/core/templates/components/question-directives/question-editor/question-editor.component.html b/core/templates/components/question-directives/question-editor/question-editor.component.html index 231a62e51494..db7adf01536e 100644 --- a/core/templates/components/question-directives/question-editor/question-editor.component.html +++ b/core/templates/components/question-directives/question-editor/question-editor.component.html @@ -9,7 +9,8 @@ (onSaveInapplicableSkillMisconceptionIds)="saveInapplicableSkillMisconceptionIds($event)" [interactionIsShown]="interactionIsShown" [stateContentPlaceholder]="getStateContentPlaceholder()" - [stateContentSaveButtonPlaceholder]="getStateContentSaveButtonPlaceholder()"> + [stateContentSaveButtonPlaceholder]="getStateContentSaveButtonPlaceholder()" + [stateContentShouldStayVisibleOnScroll]="stateContentShouldStayVisibleOnScroll"> diff --git a/core/templates/components/question-directives/question-editor/question-editor.component.ts b/core/templates/components/question-directives/question-editor/question-editor.component.ts index 7f17fae276cf..e27732bdd5df 100644 --- a/core/templates/components/question-directives/question-editor/question-editor.component.ts +++ b/core/templates/components/question-directives/question-editor/question-editor.component.ts @@ -60,6 +60,7 @@ export class QuestionEditorComponent implements OnInit, OnDestroy { @Input() question!: Question; @Input() questionId!: string; @Input() questionStateData!: State; + @Input() stateContentShouldStayVisibleOnScroll!: boolean; interactionIsShown!: boolean; oppiaBlackImgUrl!: string; stateEditorIsInitialized!: boolean; diff --git a/core/templates/components/question-directives/questions-list/questions-list.component.html b/core/templates/components/question-directives/questions-list/questions-list.component.html index e6ab31fb5cc9..930a27b8d991 100644 --- a/core/templates/components/question-directives/questions-list/questions-list.component.html +++ b/core/templates/components/question-directives/questions-list/questions-list.component.html @@ -43,7 +43,8 @@

Linked Skills

[misconceptionsBySkill]="misconceptionsBySkill" [questionStateData]="questionStateData" [question]="question" - [userCanEditQuestion]="canEditQuestion"> + [userCanEditQuestion]="canEditQuestion" + [stateContentShouldStayVisibleOnScroll]="false">
{{questionValidationService.getValidationErrorMessage(question)}} diff --git a/core/templates/components/state-editor/state-editor.component.html b/core/templates/components/state-editor/state-editor.component.html index 2622ce6b9754..9fbe2fa5f225 100644 --- a/core/templates/components/state-editor/state-editor.component.html +++ b/core/templates/components/state-editor/state-editor.component.html @@ -23,7 +23,7 @@

Responses

- +

Content

@@ -92,6 +92,12 @@

Content