diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index a1358341cc..7861be295a 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -346,9 +346,11 @@ z-index: 2; } +/* .dropzone * { pointer-events: none; } +*/ .dragover { background-color: #55A; diff --git a/InvenTree/stock/templates/stock/item_attachments.html b/InvenTree/stock/templates/stock/item_attachments.html index 2d056afbcf..453ab7f09b 100644 --- a/InvenTree/stock/templates/stock/item_attachments.html +++ b/InvenTree/stock/templates/stock/item_attachments.html @@ -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 }}", {