2022-05-03 21:15:49 +08:00
|
|
|
export default {
|
2022-05-04 16:25:53 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
confirmingDelete: false
|
|
|
|
};
|
|
|
|
},
|
2022-05-03 21:15:49 +08:00
|
|
|
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;
|
2022-05-03 21:15:49 +08:00
|
|
|
},
|
2022-05-30 19:45:51 +08:00
|
|
|
deleteElement() {
|
2022-05-03 21:15:49 +08:00
|
|
|
$.ajax({
|
2022-05-05 18:56:31 +08:00
|
|
|
url: this.element.attributes.orderable.urls.delete_url,
|
2022-05-03 21:15:49 +08:00
|
|
|
type: 'DELETE',
|
|
|
|
success: (result) => {
|
|
|
|
this.$emit(
|
|
|
|
'component:delete',
|
2022-05-25 20:23:35 +08:00
|
|
|
this.element.attributes.position
|
2022-05-03 21:15:49 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|