From 4eafebb1aae544fabb2b2d25e4ca2c7c5ae46d18 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sat, 10 Nov 2018 15:58:17 +0100 Subject: [PATCH] Fix markdown and rich editor. --- .../app/shared/components/markdown-editor.component.html | 2 +- .../app/shared/components/markdown-editor.component.scss | 2 +- .../app/shared/components/markdown-editor.component.ts | 7 ++++++- .../app/shared/components/rich-editor.component.html | 2 +- src/Squidex/app/shared/components/rich-editor.component.ts | 5 ++++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Squidex/app/shared/components/markdown-editor.component.html b/src/Squidex/app/shared/components/markdown-editor.component.html index 1060de076..7480c92da 100644 --- a/src/Squidex/app/shared/components/markdown-editor.component.html +++ b/src/Squidex/app/shared/components/markdown-editor.component.html @@ -9,5 +9,5 @@ - + \ No newline at end of file diff --git a/src/Squidex/app/shared/components/markdown-editor.component.scss b/src/Squidex/app/shared/components/markdown-editor.component.scss index 834b5b55c..ac0a9b9db 100644 --- a/src/Squidex/app/shared/components/markdown-editor.component.scss +++ b/src/Squidex/app/shared/components/markdown-editor.component.scss @@ -11,5 +11,5 @@ $background: #fff; @include fixed(0, 0, 0, 0); border: 0; background: $background; - z-index: 100000; + z-index: 1040; } \ No newline at end of file diff --git a/src/Squidex/app/shared/components/markdown-editor.component.ts b/src/Squidex/app/shared/components/markdown-editor.component.ts index 129abb011..3d673176a 100644 --- a/src/Squidex/app/shared/components/markdown-editor.component.ts +++ b/src/Squidex/app/shared/components/markdown-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, forwardRef, Renderer2, ViewChild } from '@angular/core'; +import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, forwardRef, Renderer2, ViewChild } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { @@ -49,6 +49,7 @@ export class MarkdownEditorComponent implements ControlValueAccessor, AfterViewI public isFullscreen = false; constructor( + private readonly changeDetector: ChangeDetectorRef, private readonly renderer: Renderer2, private readonly resourceLoader: ResourceLoaderService ) { @@ -81,6 +82,8 @@ export class MarkdownEditorComponent implements ControlValueAccessor, AfterViewI private showSelector = () => { this.assetsDialog.show(); + + this.changeDetector.detectChanges(); } public ngAfterViewInit() { @@ -188,6 +191,8 @@ export class MarkdownEditorComponent implements ControlValueAccessor, AfterViewI } this.renderer.appendChild(target, this.inner.nativeElement); + + this.changeDetector.detectChanges(); }); this.simplemde.codemirror.on('blur', () => { diff --git a/src/Squidex/app/shared/components/rich-editor.component.html b/src/Squidex/app/shared/components/rich-editor.component.html index 05dde5606..29b87e620 100644 --- a/src/Squidex/app/shared/components/rich-editor.component.html +++ b/src/Squidex/app/shared/components/rich-editor.component.html @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/src/Squidex/app/shared/components/rich-editor.component.ts b/src/Squidex/app/shared/components/rich-editor.component.ts index c2e94cf0b..5eee435e5 100644 --- a/src/Squidex/app/shared/components/rich-editor.component.ts +++ b/src/Squidex/app/shared/components/rich-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, OnDestroy, Output, ViewChild } from '@angular/core'; +import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, OnDestroy, Output, ViewChild } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { @@ -45,6 +45,7 @@ export class RichEditorComponent implements ControlValueAccessor, AfterViewInit, public assetPluginClicked = new EventEmitter(); constructor( + private readonly changeDetector: ChangeDetectorRef, private readonly resourceLoader: ResourceLoaderService ) { } @@ -65,6 +66,8 @@ export class RichEditorComponent implements ControlValueAccessor, AfterViewInit, private showSelector = () => { this.assetsDialog.show(); + + this.changeDetector.detectChanges(); } private getEditorOptions() {