From 0df410968abb6df89354c014e14e397e715ef63d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 20 Mar 2020 14:01:37 +0100 Subject: [PATCH] wip #3511 --- src/resources/views/fields/dropzone_media.blade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resources/views/fields/dropzone_media.blade.php b/src/resources/views/fields/dropzone_media.blade.php index c48afcd..098dea2 100644 --- a/src/resources/views/fields/dropzone_media.blade.php +++ b/src/resources/views/fields/dropzone_media.blade.php @@ -207,7 +207,11 @@ $baseUrl = url($crud->route . '/' . $entry->id . '/media'); $(document).on('click', '[data-dz-alt]', function () { var baseUrl = $(this).closest('.dropzone').attr('data-url'); - var t = window.prompt($(this).attr('title'), $(this).closest('[data-alt]').attr('data-alt')); + var defaultAlt = $(this).closest('[data-alt]').attr('data-alt'); + if (defaultAlt === undefined || defaultAlt === null || defaultAlt === 'null') { + defaultAlt = ''; + } + var t = window.prompt($(this).attr('title'), defaultAlt); var mediaId = $(this).closest('[data-id]').attr('data-id'); if (t) { $(this).closest('[data-alt]').attr('data-alt', t); -- 2.39.5