mirror of
				https://github.com/scinote-eln/scinote-web.git
				synced 2025-10-31 00:19:20 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			558 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			558 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import axios from '../../../../../packs/custom_axios.js';
 | |
| 
 | |
| export default {
 | |
|   data() {
 | |
|     return {
 | |
|       movingAttachment: false
 | |
|     };
 | |
|   },
 | |
|   methods: {
 | |
|     showMoveModal() {
 | |
|       this.movingAttachment = true;
 | |
|     },
 | |
|     closeMoveModal() {
 | |
|       this.movingAttachment = false;
 | |
|     },
 | |
|     moveAttachment(targetId) {
 | |
|       axios.post(this.attachment.attributes.urls.move, { target_id: targetId })
 | |
|         .then(() => {
 | |
|           this.movingAttachment = false;
 | |
|           this.$emit('attachment:moved', this.attachment.id, targetId);
 | |
|         });
 | |
|     }
 | |
|   }
 | |
| };
 |