Browse Source

UI: Fixed toggle to editor full-screen mode in JSON forms

pull/5142/head
Vladyslav_Prykhodko 5 years ago
parent
commit
647c69529c
  1. 9
      ui-ngx/src/app/shared/components/json-form/json-form.component.ts

9
ui-ngx/src/app/shared/components/json-form/json-form.component.ts

@ -15,6 +15,7 @@
/// ///
import { import {
ChangeDetectorRef,
Component, Component,
ElementRef, ElementRef,
forwardRef, forwardRef,
@ -113,7 +114,8 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato
constructor(public elementRef: ElementRef, constructor(public elementRef: ElementRef,
private translate: TranslateService, private translate: TranslateService,
private dialogs: DialogService, private dialogs: DialogService,
protected store: Store<AppState>) { protected store: Store<AppState>,
private cd: ChangeDetectorRef) {
} }
ngOnInit(): void { ngOnInit(): void {
@ -216,8 +218,8 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato
} }
private onIconClick(key: (string | number)[], private onIconClick(key: (string | number)[],
val: string, val: string,
iconSelectedFn: (icon: string) => void) { iconSelectedFn: (icon: string) => void) {
this.dialogs.materialIconPicker(val).subscribe((icon) => { this.dialogs.materialIconPicker(val).subscribe((icon) => {
if (icon && iconSelectedFn) { if (icon && iconSelectedFn) {
iconSelectedFn(icon); iconSelectedFn(icon);
@ -229,6 +231,7 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato
this.targetFullscreenElement = element; this.targetFullscreenElement = element;
this.isFullscreen = !this.isFullscreen; this.isFullscreen = !this.isFullscreen;
this.fullscreenFinishFn = fullscreenFinishFn; this.fullscreenFinishFn = fullscreenFinishFn;
this.cd.markForCheck();
} }
onFullscreenChanged(fullscreen: boolean) { onFullscreenChanged(fullscreen: boolean) {

Loading…
Cancel
Save