Merge pull request #5751 from tsiegleauq/motion-to-motion-nav

Reset the CR Mode by motion-motion navigation
This commit is contained in:
Emanuel Schütze 2020-12-03 15:02:10 +01:00 committed by GitHub
commit 2943c969ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -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<ChangeRecoMode>('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();
}
}),