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(); this.subscriptions.ngOnDestroy();
} }
public detectChanges() {
this.changeDetector.detectChanges();
}
public own<R>(subscription: Subscription | UnsubscribeFunction | Observable<R>) { public own<R>(subscription: Subscription | UnsubscribeFunction | Observable<R>) {
this.subscriptions.own(subscription); 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 = () => { private showSelector = () => {
this.assetsDialog.show(); this.assetsDialog.show();
this.detectChanges();
} }
public ngAfterViewInit() { public ngAfterViewInit() {

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

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

Loading…
Cancel
Save