diff --git a/docs/release-notes-editor.md b/docs/release-notes-editor.md index 6244b7e559176a859eadac0e31dc4479f2263283..b38a1ff97c86fbd88fb6e4f7beb17540b27267d1 100644 --- a/docs/release-notes-editor.md +++ b/docs/release-notes-editor.md @@ -1,5 +1,9 @@ Editor ====== +##1.35.2 +### Verbesserungen +- Wendet die Eigenschaft "Schreibgeschützt" auf Formel Elemente an + ## 1.35.1 ### Verbesserungen diff --git a/projects/common/components/input-elements/math-field.component.ts b/projects/common/components/input-elements/math-field.component.ts index 78a12560f22471c12c693e89e26c18b435a636b7..b4b5dabe41cc84460d722c0392412b1fc7ab7812 100644 --- a/projects/common/components/input-elements/math-field.component.ts +++ b/projects/common/components/input-elements/math-field.component.ts @@ -19,6 +19,7 @@ import { MathFieldElement } from 'common/models/elements/input-elements/math-fie [style.backgroundColor]="elementModel.styling.backgroundColor"> <label>{{elementModel.label}}</label><br> <aspect-mathlive-math-field [value]="$any(elementModel.value) | getValue: elementFormControl.value : parentForm" + [readonly]="elementModel.readOnly" [enableModeSwitch]="elementModel.enableModeSwitch" (input)="elementFormControl.setValue($any($event.target).value)" (focusout)="elementFormControl.markAsTouched()"> diff --git a/projects/common/math-editor.module.ts b/projects/common/math-editor.module.ts index 4c459e468e8c598fb3f798bbb0f9e98a07666318..f794a8560329a187200e938c37d453afbe9e6be8 100644 --- a/projects/common/math-editor.module.ts +++ b/projects/common/math-editor.module.ts @@ -17,16 +17,18 @@ import { MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/ <mat-button-toggle value="math">Formel</mat-button-toggle> <mat-button-toggle value="text">Text</mat-button-toggle> </mat-button-toggle-group> - <div #mathfield> + <div #mathfield [class.read-only]="readonly"> </div> `, styles: [ 'mat-button-toggle-group {height: 20px;}', + ':host ::ng-deep .read-only math-field {outline: unset}', ':host ::ng-deep .mat-button-toggle-label-content {line-height: unset}' ] }) export class MathInputComponent implements AfterViewInit, OnChanges { @Input() value!: string; + @Input() readonly!: boolean; @Input() enableModeSwitch: boolean = false; @ViewChild('mathfield') mathfieldRef!: ElementRef; @@ -37,7 +39,7 @@ export class MathInputComponent implements AfterViewInit, OnChanges { virtualKeyboards: 'aspect-keyboard roman greek', keypressSound: null, plonkSound: null, - decimalSeparator: ',', + decimalSeparator: ',' // defaultMode: 'math' }); @@ -48,6 +50,7 @@ export class MathInputComponent implements AfterViewInit, OnChanges { setupMathfield(): void { this.mathfieldRef.nativeElement.appendChild(this.mathFieldElement); this.mathFieldElement.value = this.value; + this.mathFieldElement.readOnly = this.readonly; } static setupKeyboard(): Record<string, VirtualKeyboardDefinition> {