2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 13:56:30 +00:00

Enable drag-and-drop attachment upload for Part

This commit is contained in:
Oliver Walters
2020-05-13 11:13:26 +10:00
parent cedf9a9108
commit db01f3646a
3 changed files with 25 additions and 1 deletions

View File

@ -16,6 +16,20 @@
{% block js_ready %}
{{ block.super }}
enableDragAndDrop(
'#attachment-dropzone',
"{% url 'part-attachment-create' %}",
{
data: {
part: {{ part.id }},
},
label: 'attachment',
success: function(data, status, xhr) {
location.reload();
}
}
);
$("#new-attachment").click(function() {
launchModalForm("{% url 'part-attachment-create' %}?part={{ part.id }}",
{