import {Component} from './component';
-import {getLoading, htmlToDom} from '../services/dom';
-import {buildForInput} from "../wysiwyg/config";
+import {getLoading, htmlToDom} from '../services/dom.ts';
+import {buildForInput} from '../wysiwyg-tinymce/config';
export class PageComment extends Component {
this.toggleEditMode(true);
if (this.wysiwygEditor) {
+ this.wysiwygEditor.focus();
return;
}
window.tinymce.init(config).then(editors => {
this.wysiwygEditor = editors[0];
+ setTimeout(() => this.wysiwygEditor.focus(), 50);
});
}
this.form.toggleAttribute('hidden', true);
const reqData = {
- text: this.input.value,
+ html: this.wysiwygEditor.getContent(),
parent_id: this.parentId || null,
};
this.showLoading();
await window.$http.delete(`/comment/${this.commentId}`);
+ this.$emit('delete');
this.container.closest('.comment-branch').remove();
window.$events.success(this.deletedText);
- this.$emit('delete');
}
showLoading() {