scinote-web/app/javascript/vue/shared/content/mixins/delete.js
2023-07-21 10:35:14 +02:00

28 lines
569 B
JavaScript

export default {
data() {
return {
confirmingDelete: false
};
},
methods: {
showDeleteModal(event) {
event.stopPropagation();
this.confirmingDelete = true;
},
closeDeleteModal() {
this.confirmingDelete = false;
},
deleteElement() {
$.ajax({
url: this.element.attributes.orderable.urls.delete_url,
type: 'DELETE',
success: (result) => {
this.$emit(
'component:delete',
this.element.attributes.position
);
}
});
}
}
};