fixes icon picker
This commit is contained in:
@@ -28,10 +28,11 @@
|
|||||||
await tick();
|
await tick();
|
||||||
const dropdownMenu = document.querySelector(".menu");
|
const dropdownMenu = document.querySelector(".menu");
|
||||||
if (dropdownMenu) {
|
if (dropdownMenu) {
|
||||||
let dropdownHTML = dropdownMenu.innerHTML;
|
for (let i = 0; i < dropdownMenu.children.length; i++) {
|
||||||
|
const li = dropdownMenu.children[i];
|
||||||
for (const li of dropdownMenu.children) {
|
|
||||||
const textNode = li.getElementsByTagName("p")[0];
|
const textNode = li.getElementsByTagName("p")[0];
|
||||||
|
textNode.innerHTML = items[i].text;
|
||||||
|
|
||||||
const text = textNode.innerText.replace(
|
const text = textNode.innerText.replace(
|
||||||
new RegExp(value, "gi"),
|
new RegExp(value, "gi"),
|
||||||
(match) => `<strong>${match}</strong>`,
|
(match) => `<strong>${match}</strong>`,
|
||||||
|
|||||||
@@ -22,7 +22,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
{#if icon.length > 0}
|
{#if icon.length > 0}
|
||||||
<i class="fa fa-{icon}"></i>
|
<div class="w-6">
|
||||||
|
<i class="fa fa-{icon}"></i>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<input
|
<input
|
||||||
{name}
|
{name}
|
||||||
|
|||||||
@@ -256,7 +256,7 @@
|
|||||||
? getFileURL(trail, trail.photos[trail.thumbnail])
|
? getFileURL(trail, trail.photos[trail.thumbnail])
|
||||||
: "/imgs/default_thumbnail.webp";
|
: "/imgs/default_thumbnail.webp";
|
||||||
route.bindPopup(
|
route.bindPopup(
|
||||||
`<a href="/trail/view/${trail.id}" data-sveltekit-preload-data="false">
|
`<a href="/trail/view/${trail.id}" data-sveltekit-preload-data="off">
|
||||||
<li class="flex items-center gap-4 cursor-pointer text-black max-w-80">
|
<li class="flex items-center gap-4 cursor-pointer text-black max-w-80">
|
||||||
<div class="shrink-0"><img class="h-14 w-14 object-cover rounded-xl" src="${thumbnail}" alt="">
|
<div class="shrink-0"><img class="h-14 w-14 object-cover rounded-xl" src="${thumbnail}" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export async function trails_index(perPage: number = 21, random: boolean = false
|
|||||||
|
|
||||||
export async function trails_search_filter(filter: TrailFilter, page: number = 1, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
|
export async function trails_search_filter(filter: TrailFilter, page: number = 1, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
|
||||||
let filterText: string = buildFilterText(filter, true);
|
let filterText: string = buildFilterText(filter, true);
|
||||||
|
|
||||||
let r = await f("/api/v1/search/trails", {
|
let r = await f("/api/v1/search/trails", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({ q: filter.q, options: { filter: filterText, sort: [`${filter.sort}:${filter.sortOrder == "+" ? "asc" : "desc"}`], hitsPerPage: 21, page: page } }),
|
body: JSON.stringify({ q: filter.q, options: { filter: filterText, sort: [`${filter.sort}:${filter.sortOrder == "+" ? "asc" : "desc"}`], hitsPerPage: 21, page: page } }),
|
||||||
@@ -120,7 +120,9 @@ export async function trails_search_bounding_box(northEast: LatLng, southWest: L
|
|||||||
|
|
||||||
const comparison = compareObjectArrays<Trail>(get(trails), response.items)
|
const comparison = compareObjectArrays<Trail>(get(trails), response.items)
|
||||||
|
|
||||||
trails.set(response.items);
|
if (comparison.added.length || comparison.deleted.length || comparison.updated.length) {
|
||||||
|
trails.set(response.items);
|
||||||
|
}
|
||||||
|
|
||||||
return comparison;
|
return comparison;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -362,6 +362,7 @@ export const GpxGroup = L.GpxGroup = L.Class.extend({
|
|||||||
}
|
}
|
||||||
await elevation._initHotLine(route, this._hotline)
|
await elevation._initHotLine(route, this._hotline)
|
||||||
|
|
||||||
|
|
||||||
this._map.flyToBounds(route.getBounds(), { duration: 0.25, easeLinearity: 0.25, noMoveStart: true });
|
this._map.flyToBounds(route.getBounds(), { duration: 0.25, easeLinearity: 0.25, noMoveStart: true });
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSearchClick(item: SearchItem) {
|
function handleSearchClick(item: SearchItem) {
|
||||||
map.setView([item.value._geo.lat, item.value._geo.lng], 12);
|
map.setView([item.value._geo.lat, item.value._geo.lng], 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function searchTrails(northEast: LatLng, southWest: LatLng) {
|
async function searchTrails(northEast: LatLng, southWest: LatLng) {
|
||||||
@@ -130,7 +130,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMapInit() {
|
function handleMapInit() {
|
||||||
if (settings && settings.mapFocus == "trails") {
|
if (
|
||||||
|
$page.url.searchParams.has("tl_lat") &&
|
||||||
|
$page.url.searchParams.has("tl_lon") &&
|
||||||
|
$page.url.searchParams.has("br_lat") &&
|
||||||
|
$page.url.searchParams.has("br_lon")
|
||||||
|
) {
|
||||||
|
const boundingBox: LatLngBoundsExpression = [
|
||||||
|
[parseFloat($page.url.searchParams.get("br_lat")!), parseFloat($page.url.searchParams.get("tl_lon")!)],
|
||||||
|
[parseFloat($page.url.searchParams.get("tl_lat")!), parseFloat($page.url.searchParams.get("br_lon")!)],
|
||||||
|
];
|
||||||
|
map.fitBounds(boundingBox);
|
||||||
|
} else if (settings && settings.mapFocus == "trails") {
|
||||||
const boundingBox: LatLngBoundsExpression = [
|
const boundingBox: LatLngBoundsExpression = [
|
||||||
[maxBoundingBox.max_lat, maxBoundingBox.min_lon],
|
[maxBoundingBox.max_lat, maxBoundingBox.min_lon],
|
||||||
[maxBoundingBox.min_lat, maxBoundingBox.max_lon],
|
[maxBoundingBox.min_lat, maxBoundingBox.max_lon],
|
||||||
@@ -206,8 +217,11 @@
|
|||||||
{#if $trails.length == 0}
|
{#if $trails.length == 0}
|
||||||
<EmptyStateSearch></EmptyStateSearch>
|
<EmptyStateSearch></EmptyStateSearch>
|
||||||
{/if}
|
{/if}
|
||||||
{#each $trails as trail,i}
|
{#each $trails as trail, i}
|
||||||
<a href="map/trail/{trail.id}">
|
<a
|
||||||
|
data-sveltekit-preload-data="off"
|
||||||
|
href="map/trail/{trail.id}"
|
||||||
|
>
|
||||||
<TrailCard
|
<TrailCard
|
||||||
{trail}
|
{trail}
|
||||||
on:mouseenter={() => handleTrailCardMouseEnter(trail)}
|
on:mouseenter={() => handleTrailCardMouseEnter(trail)}
|
||||||
@@ -217,7 +231,10 @@
|
|||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div id="trail-map" class:hidden={!showMap && browser && window.innerWidth < 768}>
|
<div
|
||||||
|
id="trail-map"
|
||||||
|
class:hidden={!showMap && browser && window.innerWidth < 768}
|
||||||
|
>
|
||||||
<MapWithElevationMultiple
|
<MapWithElevationMultiple
|
||||||
on:moveend={handleMapMove}
|
on:moveend={handleMapMove}
|
||||||
on:init={handleMapInit}
|
on:init={handleMapInit}
|
||||||
|
|||||||
Reference in New Issue
Block a user