From a410083349113f6367006f26a684e9e239f75a2c Mon Sep 17 00:00:00 2001 From: Sean Date: Wed, 2 Dec 2020 12:42:03 +0100 Subject: [PATCH] Reset the CR Mode by motion-motion navigation Set the CR mode to default if navigating from one motion to the other motion instead of keeping the previously selected CD mode --- .../motion-detail/motion-detail.component.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts index 15c2e2257..6b57e644a 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts @@ -360,10 +360,15 @@ export class MotionDetailComponent extends BaseViewComponentDirective implements public lnMode: LineNumberingMode; /** - * Indicates the Change reco Mode. + * Indicates the current change reco mode. */ public crMode: ChangeRecoMode; + /** + * Indicates the default change reco mode. + */ + private defaultCrMode: ChangeRecoMode; + /** * Indicates the maximum line length as defined in the configuration. */ @@ -544,7 +549,8 @@ export class MotionDetailComponent extends BaseViewComponentDirective implements .subscribe(mode => (this.lnMode = mode)); this.configService.get('motions_recommendation_text_mode').subscribe(mode => { if (mode) { - this.crMode = this.determineCrMode(mode); + this.defaultCrMode = mode; + this.resetCrMode(); } }); this.configService @@ -634,6 +640,10 @@ export class MotionDetailComponent extends BaseViewComponentDirective implements }); } + private resetCrMode(): void { + this.crMode = this.determineCrMode(this.defaultCrMode); + } + /** * Retrieves */ @@ -739,6 +749,7 @@ export class MotionDetailComponent extends BaseViewComponentDirective implements if (!this.editMotion) { this.patchForm(this.motion); } + this.resetCrMode(); this.cd.markForCheck(); } }),