Skip to content

Commit 8843e3a

Browse files
committed
Fixed the "fix"
Last fix wasnt actually the right thing. Now looking at the actual size of the background image and setting the element to that size.
1 parent 2854c23 commit 8843e3a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

resources/views/admin/seatingplans/show.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ class="btn btn-primary">
123123
<div class="seating-plan" style="
124124
@if($plan->image_url)
125125
background-image:url('{{ $plan->image_url }}');
126-
background-size: contain;
127-
background-repeat: no-repeat;
126+
min-height: {{ getimagesize($plan->image_url)[1] }}px"
127+
@else
128+
min-height: {{ (collect($seats[$plan->id] ?? [])->max('y') * 2) + 4 }}em;"
128129
@endif
129-
min-height: {{ ($seats->max('y') * 2) + 4 }}em;"
130130
>
131131
@foreach($seats as $seat)
132132
@php

resources/views/seatingplans/_plan.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<div class="seating-plan" style="
33
@if($plan->image_url)
44
background-image:url('{{ $plan->image_url }}');
5-
background-size: contain;
6-
background-repeat: no-repeat;
5+
min-height: {{ getimagesize($plan->image_url)[1] }}px"
6+
@else
7+
min-height: {{ (collect($seats[$plan->id] ?? [])->max('y') * 2) + 4 }}em;"
78
@endif
8-
min-height: {{ (collect($seats[$plan->id] ?? [])->max('y') * 2) + 4 }}em;"
99
>
1010
@foreach($seats[$plan->id] ?? [] as $seat)
1111
@php

0 commit comments

Comments
 (0)