Orte features

This commit is contained in:
Simon Martens
2025-09-28 12:27:57 +02:00
parent baa950d092
commit 0329ba5f5c
4 changed files with 23 additions and 27 deletions

View File

@@ -351,7 +351,7 @@ const I = function() {
}
}
};
class D extends HTMLElement {
class F extends HTMLElement {
constructor() {
super(), this.scrollTimeout = null, this.clickHandlers = [], this.manualNavigation = !1, this.handleScroll = this.handleScroll.bind(this);
}
@@ -513,8 +513,8 @@ class D extends HTMLElement {
e && (e.style.opacity = "0", e.style.height = "0"), this.sections = null, this.navLinks = null, this.clickHandlers = [], this.manualNavigation = !1;
}
}
customElements.define("akteure-scrollspy", D);
class F extends HTMLElement {
customElements.define("akteure-scrollspy", F);
class D extends HTMLElement {
constructor() {
super(), this.searchInput = null, this.placeCards = [], this.countElement = null, this.debounceTimer = null, this.originalCount = 0;
}
@@ -577,9 +577,7 @@ class j extends HTMLElement {
this.cleanupEventListeners(), this.cleanupMapEventListeners();
}
cleanupMapEventListeners() {
document.removeEventListener("place-map-clicked", this.handleMapClick.bind(this));
const e = this.querySelector(".cursor-pointer");
e && (e.removeEventListener("mouseenter", this.handleHeadingHover.bind(this)), e.removeEventListener("mouseleave", this.handleHeadingLeave.bind(this)));
document.removeEventListener("place-map-clicked", this.handleMapClick.bind(this)), this.removeEventListener("mouseenter", this.handleHeadingHover.bind(this)), this.removeEventListener("mouseleave", this.handleHeadingLeave.bind(this));
}
setupAccordion() {
if (!this.querySelector(".accordion-chevron")) {
@@ -603,8 +601,7 @@ class j extends HTMLElement {
document.addEventListener("place-map-clicked", this.handleMapClick.bind(this));
}
setupHoverEvents() {
const e = this.querySelector(".cursor-pointer");
e && (e.addEventListener("mouseenter", this.handleHeadingHover.bind(this)), e.addEventListener("mouseleave", this.handleHeadingLeave.bind(this)));
this.addEventListener("mouseenter", this.handleHeadingHover.bind(this)), this.addEventListener("mouseleave", this.handleHeadingLeave.bind(this));
}
handleHeadingHover() {
const e = this.getAttribute("data-place-id");
@@ -822,7 +819,7 @@ class K extends HTMLElement {
this.intersectionObserver && (this.intersectionObserver.disconnect(), this.intersectionObserver = null), this.tooltipTimeout && (clearTimeout(this.tooltipTimeout), this.tooltipTimeout = null), document.removeEventListener("place-heading-hover", this.handleHeadingHoverEvent.bind(this));
}
}
customElements.define("places-filter", F);
customElements.define("places-filter", D);
customElements.define("place-accordion", j);
customElements.define("places-map", K);
class W extends HTMLElement {

File diff suppressed because one or more lines are too long

View File

@@ -20,12 +20,17 @@
<div class="block p-4 hover:bg-slate-50 transition-colors duration-200 cursor-pointer">
<div class="flex items-start justify-between gap-2">
<div class="flex-1 min-w-0">
<h3 class="font-bold text-slate-800 mb-1 truncate">
{{ if $place.Names }}
{{ index $place.Names 0 }}
{{ else }}
{{ $place.ID }}
{{ end }}
<h3 class="font-bold text-slate-800 mb-1 truncate flex items-center gap-2">
<span class="truncate">
{{ if $place.Names }}
{{ index $place.Names 0 }}
{{ else }}
{{ $place.ID }}
{{ end }}
</span>
<a href="/ort/{{ $place.ID }}" class="flex-shrink-0 text-slate-400 hover:text-slate-600 transition-colors no-underline" title="Permalink" onclick="event.stopPropagation()">
<i class="ri-link text-sm"></i>
</a>
</h3>
{{ if ne $geonames nil }}
{{ $fullInfo := GetFullPlaceInfo $place.Geo $mainPlaceName }}

View File

@@ -148,11 +148,8 @@ export class PlaceAccordion extends HTMLElement {
document.removeEventListener('place-map-clicked', this.handleMapClick.bind(this));
// Clean up hover event listeners
const headerDiv = this.querySelector('.cursor-pointer');
if (headerDiv) {
headerDiv.removeEventListener('mouseenter', this.handleHeadingHover.bind(this));
headerDiv.removeEventListener('mouseleave', this.handleHeadingLeave.bind(this));
}
this.removeEventListener('mouseenter', this.handleHeadingHover.bind(this));
this.removeEventListener('mouseleave', this.handleHeadingLeave.bind(this));
}
setupAccordion() {
@@ -202,12 +199,9 @@ export class PlaceAccordion extends HTMLElement {
}
setupHoverEvents() {
// Find the clickable header div within this accordion
const headerDiv = this.querySelector('.cursor-pointer');
if (headerDiv) {
headerDiv.addEventListener('mouseenter', this.handleHeadingHover.bind(this));
headerDiv.addEventListener('mouseleave', this.handleHeadingLeave.bind(this));
}
// Add hover listeners to the entire accordion element (including expanded content)
this.addEventListener('mouseenter', this.handleHeadingHover.bind(this));
this.addEventListener('mouseleave', this.handleHeadingLeave.bind(this));
}
handleHeadingHover() {