0
0
Fork 0
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:
Dan Brown 2024-01-30 15:16:58 +00:00
parent 5c92b72fdd
commit adf0baebb9
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
6 changed files with 34 additions and 36 deletions
resources/js/components

View file

@ -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,
};