|
|
|
@ -22,10 +22,14 @@ export default class PostEditor {
|
|
|
|
|
this.post = [];
|
|
|
|
|
this.postID = null;
|
|
|
|
|
this.postUUID = null;
|
|
|
|
|
this.postLayout = null;
|
|
|
|
|
api.authStatus();
|
|
|
|
|
if (document.getElementById('post-edit-index').getAttribute('data-index')) {
|
|
|
|
|
this.postID = document.getElementById('post-edit-index').getAttribute('data-index');
|
|
|
|
|
this.postUUID = document.getElementById('post-edit-index').getAttribute('data-uuid');
|
|
|
|
|
this.postLayout = document
|
|
|
|
|
.getElementById('post-edit-index')
|
|
|
|
|
.getAttribute('data-layout');
|
|
|
|
|
}
|
|
|
|
|
if (document.getElementById('edit-post-text')) {
|
|
|
|
|
this.editor = new TextEditor(
|
|
|
|
@ -163,6 +167,10 @@ export default class PostEditor {
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case EditorEvent.EDITOR_DELETE:
|
|
|
|
|
if (this.postLayout === 'index') {
|
|
|
|
|
notify.alert('Index cannot be deleted', false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (confirm("AYE! You know you're deleting this post, right?")) {
|
|
|
|
|
let id = { id: this.postUUID };
|
|
|
|
|
api.request(
|
|
|
|
|