mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
fix(tinymce): set absolute path for skin url (#5491)
This commit is contained in:
parent
251659b4fa
commit
6a9a33d0de
1 changed files with 37 additions and 0 deletions
37
src/app/@theme/components/tiny-mce/tiny-mce.component.ts
Normal file
37
src/app/@theme/components/tiny-mce/tiny-mce.component.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
import { Component, OnDestroy, AfterViewInit, Output, EventEmitter, ElementRef } from '@angular/core';
|
||||||
|
import { LocationStrategy } from '@angular/common';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-tiny-mce',
|
||||||
|
template: '',
|
||||||
|
})
|
||||||
|
export class TinyMCEComponent implements OnDestroy, AfterViewInit {
|
||||||
|
|
||||||
|
@Output() editorKeyup = new EventEmitter<any>();
|
||||||
|
|
||||||
|
editor: any;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private host: ElementRef,
|
||||||
|
private locationStrategy: LocationStrategy,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
tinymce.init({
|
||||||
|
target: this.host.nativeElement,
|
||||||
|
plugins: ['link', 'paste', 'table'],
|
||||||
|
skin_url: `${this.locationStrategy.getBaseHref()}assets/skins/lightgray`,
|
||||||
|
setup: editor => {
|
||||||
|
this.editor = editor;
|
||||||
|
editor.on('keyup', () => {
|
||||||
|
this.editorKeyup.emit(editor.getContent());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
height: '320',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
tinymce.remove(this.editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue