@HolgerJeromin commented on this pull request.


> +  const heatmapElement = document.querySelector("#cal-heatmap");
+
+  if (!heatmapElement) {
+    console.warn("Heatmap element not found in the DOM.");
+    return;
+  }
+
+
+  const heatmapData = heatmapElement.dataset.heatmap ? 
JSON.parse(heatmapElement.dataset.heatmap) : [];
+
+  try {
+    // eslint-disable-line no-undef
+    const cal = new CalHeatmap();
+    const applicationData = $("head").data();
+    const locale = applicationData.locale;
+    const theme = getTheme();

We can watch for change of color theme with 
https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/change_event

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5402#pullrequestreview-2508058564
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5402/review/2508058...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to