]> _ Git - cubist_cms-back.git/commitdiff
wait #4851 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 Nov 2021 10:55:17 +0000 (11:55 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 Nov 2021 10:55:17 +0000 (11:55 +0100)
src/resources/views/fields/dropzone_media.blade.php

index 576ea0c5a7d20856753a0638c18cf9565bdbb238..12ca8726ac5305b475f7f7f894fe6d4a26215308 100644 (file)
@@ -194,6 +194,17 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ??
                 Dropzone.autoDiscover = false;
 
                 jQuery(document).ready(function () {
+
+                    $(document).on('click', '[data-dz-download]', function () {
+                        var t = $(this).closest('.dz-complete').find('[data-dz-thumbnail]');
+                        var e = $(t).attr('src').split('/');
+                        e.pop();
+                        e.pop();
+                        e.push($(t).attr('alt'));
+                        window.open(e.join('/'), '_blank');
+                        return false;
+                    });
+
                     var uniqid = function () {
                         return (new Date().getTime() + Math.floor((Math.random() * 10000) + 1)).toString(16);
                     };
@@ -216,6 +227,7 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ??
                         });
                     }
 
+
                     function initOneDropzone(el) {
                         var el = $(el);
                         var base_url = el.data('url');
@@ -333,7 +345,6 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ??
                             }).show();
                         });
 
-
                         var dropzone_sortable = new Sortable(document.getElementById(el_id), {
                             handle: ".dz-preview",
                             draggable: ".dz-preview",