scinote-web/app/javascript/vue/protocol/mixins/components/delete.js
artoscinote 23872f519b
Implement step element sorting modal [SCI-6849] (#4124)
* Implement step element sorting modal [SCI-6849]

* Implement step reordering modal [SCI-6850]

* Refactor reorderable items a bit [SCI-6850]
2022-05-30 13:45:51 +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
);
}
});
}
}
};