Commit b20001b0 authored by f00wl's avatar f00wl 🦉

fix image preview

parent 32c2302d
......@@ -16,22 +16,22 @@
<div class="col-sm-6">
<h6 class="mt-3 font-weight-bold text-uppercase m-0">{{ form_label(form.logo, 'Logo') }}</h6>
{{ form_widget(form.logo, {'attr': {'class': 'hold','placeholder': 'pour un apperçu complet, privilégiez un format carré',
'onchange':'previewTheaterLogo(event)'}}) }}
'onchange':'preview_logo(event)'}}) }}
{{ form_help(form.logo) }}
</div>
<div class="col-sm-6 my-2">
<div class="rounded-circle border border-dark"
<div id="output_theater_logo" class="rounded-circle border border-dark"
style="background:transparent url({{ asset('uploads/images/' ~ theater.logo) }}) center; background-size: cover; height: 140px; width:140px">
</div>
</div>
<div class="col-sm-6">
<h6 class="mt-3 font-weight-bold text-uppercase m-0">{{ form_label(form.picture, 'Photo') }}</h6>
{{ form_widget(form.picture, {'attr': {'class': 'hold','placeholder': 'format 16:9 recommandé',
'onchange':'previewTheaterPhoto(event)'}}) }}
'onchange':'preview_photo(event)'}}) }}
{{ form_help(form.picture) }}
</div>
<div class="col-sm-6">
<div class="rounded border border-dark"
<div id="output_theater_photo" class="rounded border border-dark"
style="background:transparent url({{ asset('uploads/images/' ~ theater.picture) }}) center; background-size: cover; height:135px; width:240px">
</div>
</div>
......@@ -117,7 +117,7 @@
var reader = new FileReader();
reader.onload = function () {
var output = document.getElementById('output_theater_logo');
output.src = reader.result;
output.style.backgroundImage = "url(" + reader.result + ")";
}
reader.readAsDataURL(event.target.files[0]);
}
......@@ -126,7 +126,7 @@
var reader = new FileReader();
reader.onload = function () {
var output = document.getElementById('output_theater_photo');
output.src = reader.result;
output.style.backgroundImage = "url(" + reader.result + ")";
}
reader.readAsDataURL(event.target.files[0]);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment