Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add draggable area for sorting images.

Marco Badan1bed11c9be59
diff --git a/saleor/static/js/dashboard.js b/saleor/static/js/dashboard.js
index 4f1e6d3dfb..735ddd4379 100644
--- a/saleor/static/js/dashboard.js
+++ b/saleor/static/js/dashboard.js
@@ -184,7 +184,7 @@ Dropzone.options.productImageForm = {
let el = document.getElementById('product-gallery');
if (el) {
Sortable.create(el, {
- handle: '.sortable__handle',
+ handle: '.sortable__drag-area',
onUpdate: function () {
$.ajax({
dataType: 'json',
diff --git a/saleor/static/scss/dashboard/widget/_product-gallery.scss b/saleor/static/scss/dashboard/widget/_product-gallery.scss
index 5735c7a403..adb6920d05 100644
--- a/saleor/static/scss/dashboard/widget/_product-gallery.scss
+++ b/saleor/static/scss/dashboard/widget/_product-gallery.scss
@@ -57,6 +57,7 @@
}
}
.sortable__drag-area {
+ background-color: grey;
position: absolute;
top: 0;
right: 0;
diff --git a/templates/dashboard/product/product_form.html b/templates/dashboard/product/product_form.html
index 4acc1dfdc0..b2a63270b5 100644
--- a/templates/dashboard/product/product_form.html
+++ b/templates/dashboard/product/product_form.html
@@ -322,6 +322,7 @@
{% trans "Delete" %}
</a>
</div>
+ <div class="sortable__drag-area"></div>
</li>
{% endfor %}
{% else %}