scinote-web/app/javascript/vue/shared/content/mixins/delete.js

29 lines
569 B
JavaScript
Raw Normal View History

export default {
2022-05-04 16:25:53 +08:00
data() {
return {
confirmingDelete: false
};
},
methods: {
2022-05-10 19:28:09 +08:00
showDeleteModal(event) {
event.stopPropagation();
2022-05-04 16:25:53 +08:00
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
);
}
});
}
}
};