adds list link sharing
This commit is contained in:
@@ -36,9 +36,9 @@
|
||||
(gpxData.length != gpxGroup._tracks.length ||
|
||||
gpxGroup?._tracks[0] !== gpxData[0])
|
||||
) {
|
||||
if (gpxData.length == 0) {
|
||||
map?.setView([0, 0], 4);
|
||||
}
|
||||
// if (gpxData.length == 0) {
|
||||
// map?.setView([0, 0], 4);
|
||||
// }
|
||||
gpxGroup._elevation.updateOptions({
|
||||
autofitBounds: options.autofitBounds ?? true,
|
||||
});
|
||||
@@ -162,7 +162,7 @@
|
||||
closeBtn: false,
|
||||
followMarker: true,
|
||||
autofitBounds: true,
|
||||
imperial: $page.data.settings?.unit == "imperial" ?? false,
|
||||
imperial: $page.data.settings?.unit == "imperial",
|
||||
reverseCoords: false,
|
||||
acceleration: false,
|
||||
slope: true,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import TrailCard from "./trail_card.svelte";
|
||||
import TrailListItem from "./trail_list_item.svelte";
|
||||
|
||||
export let filter: TrailFilter;
|
||||
export let filter: TrailFilter | null = null;
|
||||
export let trails: Trail[];
|
||||
export let pagination: { page: number; totalPages: number } = {
|
||||
page: 1,
|
||||
@@ -41,10 +41,10 @@
|
||||
if (storedDisplayOption) {
|
||||
selectedDisplayOption = storedDisplayOption;
|
||||
}
|
||||
if (storedSort) {
|
||||
if (filter && storedSort) {
|
||||
filter.sort = storedSort as typeof filter.sort;
|
||||
}
|
||||
if (storedSortOrder) {
|
||||
if (filter && storedSortOrder) {
|
||||
filter.sortOrder = storedSortOrder as typeof filter.sortOrder;
|
||||
}
|
||||
if (storedSort || storedSortOrder) {
|
||||
@@ -57,11 +57,17 @@
|
||||
}
|
||||
|
||||
function setSort() {
|
||||
if(!filter) {
|
||||
return;
|
||||
}
|
||||
localStorage.setItem("sort", filter.sort);
|
||||
dispatch("update", filter);
|
||||
}
|
||||
|
||||
function setSortOrder() {
|
||||
if(!filter) {
|
||||
return;
|
||||
}
|
||||
if (filter.sortOrder === "+") {
|
||||
filter.sortOrder = "-";
|
||||
} else {
|
||||
@@ -81,23 +87,25 @@
|
||||
on:pagination
|
||||
></Pagination>
|
||||
</div>
|
||||
<div class="shrink-0">
|
||||
<p class="text-sm text-gray-500 pb-2">{$_("sort")}</p>
|
||||
<div class="flex items-center gap-2">
|
||||
<Select
|
||||
bind:value={filter.sort}
|
||||
items={sortOptions}
|
||||
on:change={setSort}
|
||||
></Select>
|
||||
<button
|
||||
id="sort-order-btn"
|
||||
class="btn-icon"
|
||||
class:rotated={filter.sortOrder == "-"}
|
||||
on:click={() => setSortOrder()}
|
||||
><i class="fa fa-arrow-up"></i></button
|
||||
>
|
||||
{#if filter}
|
||||
<div class="shrink-0">
|
||||
<p class="text-sm text-gray-500 pb-2">{$_("sort")}</p>
|
||||
<div class="flex items-center gap-2">
|
||||
<Select
|
||||
bind:value={filter.sort}
|
||||
items={sortOptions}
|
||||
on:change={setSort}
|
||||
></Select>
|
||||
<button
|
||||
id="sort-order-btn"
|
||||
class="btn-icon"
|
||||
class:rotated={filter.sortOrder == "-"}
|
||||
on:click={() => setSortOrder()}
|
||||
><i class="fa fa-arrow-up"></i></button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="shrink-0">
|
||||
<p class="text-sm text-gray-500 pb-2">{$_("display-as")}</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user