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