Skip to content

Commit

Permalink
Disable maps in exhibition pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Dec 10, 2024
1 parent a61ed38 commit e497fa3
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/scripts/exhibition.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Cookies } from "@nationalarchives/frontend/nationalarchives/all.mjs";
// import { Cookies } from "@nationalarchives/frontend/nationalarchives/all.mjs";

const cookies = new Cookies();
// const cookies = new Cookies();

const enhanceMaps = () =>
document.querySelectorAll("[data-mapembedurl]").forEach(($mapReplacement) => {
const $mapIframe = document.createElement("iframe");
$mapIframe.classList.add("tna-enhanced-map");
$mapIframe.setAttribute("tabindex", "0");
$mapIframe.setAttribute("src", $mapReplacement.dataset["mapembedurl"]);
$mapReplacement.replaceWith($mapIframe);
const mapLink = $mapReplacement.dataset["maplink"];
if (mapLink) {
const $mapLink = document.createElement("p");
$mapLink.classList.add("tna-!--margin-top-xs");
$mapLink.innerHTML = `<a href="${mapLink}">See full map</a>`;
$mapIframe.after($mapLink);
}
});
// const enhanceMaps = () =>
// document.querySelectorAll("[data-mapembedurl]").forEach(($mapReplacement) => {
// const $mapIframe = document.createElement("iframe");
// $mapIframe.classList.add("tna-enhanced-map");
// $mapIframe.setAttribute("tabindex", "0");
// $mapIframe.setAttribute("src", $mapReplacement.dataset["mapembedurl"]);
// $mapReplacement.replaceWith($mapIframe);
// const mapLink = $mapReplacement.dataset["maplink"];
// if (mapLink) {
// const $mapLink = document.createElement("p");
// $mapLink.classList.add("tna-!--margin-top-xs");
// $mapLink.innerHTML = `<a href="${mapLink}">See full map</a>`;
// $mapIframe.after($mapLink);
// }
// });

// if (cookies.isPolicyAccepted("usage")) {
// enhanceMaps();
Expand Down

0 comments on commit e497fa3

Please sign in to comment.