|
|
|
@ -118,7 +118,7 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid |
|
|
|
mode: `ace/mode/${mode}`, |
|
|
|
showGutter: true, |
|
|
|
showPrintMargin: false, |
|
|
|
readOnly: this.readonly |
|
|
|
readOnly: this.disabled || this.readonly |
|
|
|
}; |
|
|
|
|
|
|
|
const advancedOptions = { |
|
|
|
@ -185,6 +185,9 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid |
|
|
|
|
|
|
|
setDisabledState(isDisabled: boolean): void { |
|
|
|
this.disabled = isDisabled; |
|
|
|
if (this.jsonEditor) { |
|
|
|
this.jsonEditor.setReadOnly(this.disabled || this.readonly); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public validate(c: FormControl) { |
|
|
|
@ -196,7 +199,7 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid |
|
|
|
} |
|
|
|
|
|
|
|
validateOnSubmit(): void { |
|
|
|
if (!this.readonly) { |
|
|
|
if (!this.disabled && !this.readonly) { |
|
|
|
this.cleanupJsonErrors(); |
|
|
|
this.contentValid = true; |
|
|
|
this.propagateChange(this.contentBody); |
|
|
|
|