Browse Source

Fix markdown and rich editor.

pull/348/head
Sebastian Stehle 7 years ago
parent
commit
5ad0a43393
  1. 4
      src/Squidex/app/framework/angular/stateful.component.ts
  2. 2
      src/Squidex/app/shared/components/markdown-editor.component.ts
  3. 8
      src/Squidex/app/shared/components/rich-editor.component.ts

4
src/Squidex/app/framework/angular/stateful.component.ts

@ -65,6 +65,10 @@ export abstract class StatefulComponent<T = any> extends State<T> implements OnD
this.subscriptions.ngOnDestroy();
}
public detectChanges() {
this.changeDetector.detectChanges();
}
public own<R>(subscription: Subscription | UnsubscribeFunction | Observable<R>) {
this.subscriptions.own(subscription);
}

2
src/Squidex/app/shared/components/markdown-editor.component.ts

@ -83,6 +83,8 @@ export class MarkdownEditorComponent extends StatefulControlComponent<State, str
private showSelector = () => {
this.assetsDialog.show();
this.detectChanges();
}
public ngAfterViewInit() {

8
src/Squidex/app/shared/components/rich-editor.component.ts

@ -17,8 +17,8 @@ import {
AuthService,
DateTime,
DialogModel,
ExternalControlComponent,
ResourceLoaderService,
StatefulControlComponent,
Types
} from '@app/shared/internal';
@ -42,7 +42,7 @@ const ImageTypes = [
providers: [SQX_RICH_EDITOR_CONTROL_VALUE_ACCESSOR],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RichEditorComponent extends ExternalControlComponent<string> implements AfterViewInit, OnDestroy {
export class RichEditorComponent extends StatefulControlComponent<any, string> implements AfterViewInit, OnDestroy {
private tinyEditor: any;
private tinyInitTimer: any;
private value: string;
@ -62,7 +62,7 @@ export class RichEditorComponent extends ExternalControlComponent<string> implem
private readonly authState: AuthService,
private readonly resourceLoader: ResourceLoaderService
) {
super(changeDetector);
super(changeDetector, {});
}
public ngOnDestroy() {
@ -83,6 +83,8 @@ export class RichEditorComponent extends ExternalControlComponent<string> implem
private showSelector = () => {
this.assetsDialog.show();
this.detectChanges();
}
private getEditorOptions() {

Loading…
Cancel
Save