mirror of
				https://github.com/scinote-eln/scinote-web.git
				synced 2025-10-28 07:00:24 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			593 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			593 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import axios from '../../../../packs/custom_axios.js';
 | |
| 
 | |
| export default {
 | |
|   data() {
 | |
|     return {
 | |
|       movingElement: false
 | |
|     };
 | |
|   },
 | |
|   methods: {
 | |
|     showMoveModal(event) {
 | |
|       event.stopPropagation();
 | |
|       this.movingElement = true;
 | |
|     },
 | |
|     closeMoveModal() {
 | |
|       this.movingElement = false;
 | |
|     },
 | |
|     moveElement(target_id) {
 | |
|       axios.post(this.element.attributes.orderable.urls.move_url, { target_id: target_id }).
 | |
|         then(() => {
 | |
|           this.movingElement = false;
 | |
|           this.$emit('moved', this.element.attributes.position, target_id);
 | |
|         });
 | |
|     }
 | |
|   }
 | |
| };
 |