Limit checkings (temporary fix for performance degredation)

This commit is contained in:
Ben Goldsworthy 2022-10-05 19:38:45 +00:00
parent baadb8f982
commit 26684b6dc2

View file

@ -38,8 +38,7 @@
<div id="map"></div>
<section id="checkinList">
<ol reversed>
@foreach(array_reverse($trip->checkins) as $checkin)
@if($checkin->id != 2607)
@foreach(array_slice(array_reverse($trip->checkins), 0, 15) as $checkin)
<li>
<details id="{{ $checkin->id }}" ontoggle="toggleCheckin(this.open, this.id)">
<summary><h2>{{ $checkin->title ?? "[No title]" }}</h2> <span>{{ date('j M Y (G:H)', strtotime($checkin->date)) }}</span></summary>
@ -49,7 +48,6 @@
@endif
</details>
</li>
@endif
@endforeach
</ol>
</section>
@ -73,7 +71,6 @@
var marker = null, popupMarkup = null;
@foreach($trip->checkins as $checkin)
@if($checkin->id != 2602)
marker = L.marker([{{ $checkin->location->latitude }}, {{ $checkin->location->longitude }}]).addTo(map);
popupMarkup = '<h2 class="popup__title">{{ $checkin->title ?? "No Title" }}</h2>';
@ -82,7 +79,6 @@
marker.bindPopup(popupMarkup).openPopup();
checkinMarkers[{{ $checkin->id }}] = marker;
@endif
@endforeach
var currLocation = L.marker(