feat: city guide on city pages (tagline, facts, About, seasons)
Editable per city under Viator tours > Destinations. Shown above the tours on page 1 of an unfiltered listing only; filtering and paging jump to the results. Text recovered from the six old /tour-destination/ pages is imported once into empty guides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,22 @@
|
||||
});
|
||||
});
|
||||
|
||||
/* ---------- city guide: long About text folds behind "Read more" ---------- */
|
||||
Array.prototype.forEach.call(app.querySelectorAll("[data-vc-clamp]"), function (text) {
|
||||
var btn = text.nextElementSibling;
|
||||
text.classList.add("is-clamped");
|
||||
if (!btn || text.scrollHeight <= text.clientHeight + 8) {
|
||||
text.classList.remove("is-clamped");
|
||||
return;
|
||||
}
|
||||
btn.hidden = false;
|
||||
btn.addEventListener("click", function () {
|
||||
var open = text.classList.toggle("is-clamped") === false;
|
||||
btn.setAttribute("aria-expanded", open ? "true" : "false");
|
||||
btn.querySelector("span").textContent = open ? "Read less" : "Read more";
|
||||
});
|
||||
});
|
||||
|
||||
/* ---------- single tour: "view all photos" scrolls the gallery ---------- */
|
||||
var viewAll = app.querySelector(".tg-viewall, .gallery__viewall");
|
||||
if (viewAll) viewAll.addEventListener("click", function () {
|
||||
|
||||
Reference in New Issue
Block a user