Browse Source

Minor bugfix

pull/1/head
Sebastian 9 years ago
parent
commit
1f669ba061
  1. 4
      src/Squidex/app/features/content/pages/contents/contents-page.component.html
  2. 8
      src/Squidex/app/framework/angular/markdown-editor.component.ts
  3. 6
      src/Squidex/app/framework/angular/rich-editor.component.ts

4
src/Squidex/app/features/content/pages/contents/contents-page.component.html

@ -8,7 +8,9 @@
<input class="form-control" [formControl]="contentsFilter" placeholder="Search for content" /> <input class="form-control" [formControl]="contentsFilter" placeholder="Search for content" />
</form> </form>
<sqx-language-selector class="languages-buttons" (selectedLanguageChanged)="selectLanguage($event)" [languages]="languages"></sqx-language-selector> <span *ngIf="languages.length > 1">
<sqx-language-selector class="languages-buttons" (selectedLanguageChanged)="selectLanguage($event)" [languages]="languages"></sqx-language-selector>
</span>
<button class="btn btn-success" [routerLink]="['new']"> <button class="btn btn-success" [routerLink]="['new']">
<i class="icon-plus"></i> New <i class="icon-plus"></i> New

8
src/Squidex/app/framework/angular/markdown-editor.component.ts

@ -61,7 +61,7 @@ export class MarkdownEditorComponent implements ControlValueAccessor, AfterViewI
this.isDisabled = isDisabled; this.isDisabled = isDisabled;
if (this.simplemde) { if (this.simplemde) {
this.simplemde.setOption('readOnly', isDisabled); this.simplemde.codemirror.setOption('readOnly', isDisabled);
} }
} }
@ -78,12 +78,16 @@ export class MarkdownEditorComponent implements ControlValueAccessor, AfterViewI
this.simplemde = new SimpleMDE({ element: this.editor.nativeElement }); this.simplemde = new SimpleMDE({ element: this.editor.nativeElement });
this.simplemde.value(this.value || ''); this.simplemde.value(this.value || '');
this.simplemde.codemirror.on('blur', () => { this.simplemde.codemirror.on('change', () => {
const value = this.simplemde.value(); const value = this.simplemde.value();
this.changeCallback(value); this.changeCallback(value);
}); });
this.simplemde.codemirror.on('blur', () => {
this.touchedCallback();
});
this.simplemde.codemirror.on('refresh', () => { this.simplemde.codemirror.on('refresh', () => {
this.isFullscreen = this.simplemde.isFullscreenActive(); this.isFullscreen = this.simplemde.isFullscreenActive();

6
src/Squidex/app/framework/angular/rich-editor.component.ts

@ -72,12 +72,16 @@ export class RichEditorComponent implements ControlValueAccessor, AfterViewInit,
setup: (editor: any) => { setup: (editor: any) => {
self.tinyEditor = editor; self.tinyEditor = editor;
self.tinyEditor.on('blur', () => { self.tinyEditor.on('change', () => {
const value = editor.getContent(); const value = editor.getContent();
self.changeCallback(value); self.changeCallback(value);
}); });
self.tinyEditor.on('blur', () => {
self.touchedCallback();
});
setTimeout(() => { setTimeout(() => {
self.tinyEditor.setContent(this.value || ''); self.tinyEditor.setContent(this.value || '');
}, 500); }, 500);

Loading…
Cancel
Save