From: Vincent Vanwaelscappel Date: Mon, 30 Mar 2020 16:42:58 +0000 (+0200) Subject: wip #3531 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=141fe6c10f9bc63b4ce9ff6d40e882f32f268df4;p=cubist_cms-back.git wip #3531 --- diff --git a/src/resources/views/fields/dropzone_media.blade.php b/src/resources/views/fields/dropzone_media.blade.php index bd33ced..8ff0d0b 100644 --- a/src/resources/views/fields/dropzone_media.blade.php +++ b/src/resources/views/fields/dropzone_media.blade.php @@ -101,7 +101,7 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? height: 26px; border-radius: 3px 3px 0 0; background: #b50005; - z-index:21; + z-index: 21; cursor: pointer; } @@ -159,13 +159,30 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? if (!isset($files[$collection])) { $files[$collection] = []; } + + $full = null; + $thumb_url = null; + + try { + $full = $media->getUrl(); + } catch (Exception $e) { + $full = ''; + } + + try { + $thumb_url = $media->getUrl($field['thumb_collection'] ?? ''); + } catch (Exception $e) { + $thumb_url = ''; + } + + $files[$collection][] = [ 'id' => $media->id, 'order_column' => $media->order_column, 'size' => $media->size, 'name' => $media->file_name, - 'full_url' => $media->getUrl(), - 'thumb_url' => $media->getUrl($field['thumb_collection'] ?? ''), + 'full_url' => $full, + 'thumb_url' => $thumb_url ]; }