diff --git a/app/views/admin/communication/unsplash/_selector.html.erb b/app/views/admin/communication/unsplash/_selector.html.erb index 55ea99667f424085e058e4848277e0feb73e6597..fe41fc49598b6890fffd81debde0adbecc5fa4be 100644 --- a/app/views/admin/communication/unsplash/_selector.html.erb +++ b/app/views/admin/communication/unsplash/_selector.html.erb @@ -172,11 +172,12 @@ path = admin_communication_unsplash_path(website_id: nil, format: :json) this.selected = image; - if (!inputImage) ( + if (!inputImage) { inputImage = document.createElement('img'); // add img-fluid img-thumb - inputImageContainer.append(img); - ) + inputImageContainer.appendChild(img); + } + if (inputImage) { inputImage.setAttribute('src', image.preview); }