1
0
Fork 0

Update PostMenu.vue component

This commit is contained in:
Daniel Supernault 2019-02-10 21:13:09 -07:00
parent c47390d43d
commit 294a234014
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 4 additions and 30 deletions

View File

@ -100,11 +100,14 @@
.text-lighter { .text-lighter {
color:#B8C2CC !important; color:#B8C2CC !important;
} }
.modal-body {
padding: 0;
}
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
export default { export default {
props: ['status', 'profile', 'size', 'modal'], props: ['feed', 'status', 'profile', 'size', 'modal'],
methods: { methods: {
reportUrl(status) { reportUrl(status) {
@ -151,35 +154,6 @@
deletePost(status, index) { deletePost(status, index) {
if($('body').hasClass('loggedIn') == false || status.account.id !== this.profile.id) {
return;
}
axios.post('/i/delete', {
type: 'status',
item: status.id
}).then(res => {
this.feed.splice(index,1);
swal('Success', 'You have successfully deleted this post', 'success');
}).catch(err => {
swal('Error', 'Something went wrong. Please try again later.', 'error');
});
},
commentSubmit(status, $event) {
let id = status.id;
let form = $event.target;
let input = $(form).find('input[name="comment"]');
let comment = input.val();
let comments = form.parentElement.parentElement.getElementsByClassName('comments')[0];
axios.post('/i/comment', {
item: id,
comment: comment
}).then(res => {
form.reset();
form.blur();
this.replies.unshift(res.data.entity);
});
}, },
moderatePost(status, action, $event) { moderatePost(status, action, $event) {