mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Drag-and-drop attachments for stock item
This commit is contained in:
		@@ -346,9 +346,11 @@
 | 
			
		||||
    z-index: 2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
.dropzone * {
 | 
			
		||||
    pointer-events: none;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
.dragover {
 | 
			
		||||
    background-color: #55A;
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,20 @@
 | 
			
		||||
{% block js_ready %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
 | 
			
		||||
enableDragAndDrop(
 | 
			
		||||
        '#attachment-dropzone',
 | 
			
		||||
        "{% url 'stock-item-attachment-create' %}",
 | 
			
		||||
        {
 | 
			
		||||
            data: {
 | 
			
		||||
                stock_item: {{ item.id }},
 | 
			
		||||
            },
 | 
			
		||||
            label: 'attachment',
 | 
			
		||||
            success: function(data, status, xhr) {
 | 
			
		||||
                location.reload();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
$("#new-attachment").click(function() {
 | 
			
		||||
    launchModalForm("{% url 'stock-item-attachment-create' %}?item={{ item.id }}",
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user