2023-08-24 21:55:20 +08:00
|
|
|
import axios from '../../../../../packs/custom_axios.js';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
movingAttachment: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
showMoveModal(event) {
|
|
|
|
event.stopPropagation();
|
2023-08-25 15:46:53 +08:00
|
|
|
this.movingAttachment = true;
|
2023-08-24 21:55:20 +08:00
|
|
|
},
|
|
|
|
closeMoveModal() {
|
|
|
|
this.movingAttachment = false;
|
|
|
|
},
|
2023-08-25 15:46:53 +08:00
|
|
|
moveAttachment(targetId) {
|
|
|
|
axios.post(this.attachment.attributes.urls.move, { target_id: targetId })
|
|
|
|
.then(() => {
|
2023-08-24 21:55:20 +08:00
|
|
|
this.movingAttachment = false;
|
2023-08-25 15:46:53 +08:00
|
|
|
this.$emit('attachment:moved', this.attachment.id, targetId);
|
2023-08-24 21:55:20 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|