Browse Source

UI: Revert blur in json-content.component

pull/10623/head
Vladyslav_Prykhodko 2 years ago
parent
commit
e53b40f8af
  1. 17
      ui-ngx/src/app/shared/components/json-content.component.ts

17
ui-ngx/src/app/shared/components/json-content.component.ts

@ -18,13 +18,11 @@ import {
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
ElementRef, ElementRef,
EventEmitter,
forwardRef, forwardRef,
Input, Input,
OnChanges, OnChanges,
OnDestroy, OnDestroy,
OnInit, OnInit,
Output,
SimpleChanges, SimpleChanges,
ViewChild, ViewChild,
ViewEncapsulation ViewEncapsulation
@ -104,9 +102,6 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
@coerceBoolean() @coerceBoolean()
required: boolean; required: boolean;
@Output()
blur: EventEmitter<void> = new EventEmitter<void>();
fullscreen = false; fullscreen = false;
contentBody: string; contentBody: string;
@ -116,7 +111,6 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
errorShowed = false; errorShowed = false;
private propagateChange = null; private propagateChange = null;
private onTouched = () => {};
constructor(public elementRef: ElementRef, constructor(public elementRef: ElementRef,
protected store: Store<AppState>, protected store: Store<AppState>,
@ -156,14 +150,12 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
this.updateView(); this.updateView();
} }
}); });
this.jsonEditor.on('blur', () => { if (this.validateContent) {
if (this.validateContent) { this.jsonEditor.on('blur', () => {
this.contentValid = this.doValidate(true); this.contentValid = this.doValidate(true);
this.cd.markForCheck(); this.cd.markForCheck();
} });
this.onTouched(); }
this.blur.next();
});
if (this.tbPlaceholder && this.tbPlaceholder.length) { if (this.tbPlaceholder && this.tbPlaceholder.length) {
this.createPlaceholder(); this.createPlaceholder();
@ -251,7 +243,6 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
} }
registerOnTouched(fn: any): void { registerOnTouched(fn: any): void {
this.onTouched = fn;
} }
setDisabledState(isDisabled: boolean): void { setDisabledState(isDisabled: boolean): void {

Loading…
Cancel
Save