mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-09 18:40:06 +00:00
Comments: Added back-end HTML support, fixed editor focus
Also fixed handling of editors when moved in DOM, to properly remove then re-init before & after move to avoid issues.
This commit is contained in:
parent
5c92b72fdd
commit
adf0baebb9
6 changed files with 34 additions and 36 deletions
resources/js/components
|
@ -1,6 +1,6 @@
|
|||
import {Component} from './component';
|
||||
import {getLoading, htmlToDom} from '../services/dom';
|
||||
import {buildForInput} from "../wysiwyg/config";
|
||||
import {buildForInput} from '../wysiwyg/config';
|
||||
|
||||
export class PageComment extends Component {
|
||||
|
||||
|
@ -58,6 +58,7 @@ export class PageComment extends Component {
|
|||
this.toggleEditMode(true);
|
||||
|
||||
if (this.wysiwygEditor) {
|
||||
this.wysiwygEditor.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -72,6 +73,7 @@ export class PageComment extends Component {
|
|||
|
||||
window.tinymce.init(config).then(editors => {
|
||||
this.wysiwygEditor = editors[0];
|
||||
setTimeout(() => this.wysiwygEditor.focus(), 50);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -81,7 +83,7 @@ export class PageComment extends Component {
|
|||
this.form.toggleAttribute('hidden', true);
|
||||
|
||||
const reqData = {
|
||||
text: this.input.value,
|
||||
html: this.wysiwygEditor.getContent(),
|
||||
parent_id: this.parentId || null,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue