[openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)
Emin Kocan
notifications at github.com
Tue Dec 17 12:18:32 UTC 2024
@kcne 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();
Refactored the code accordingly so it takes into account if the theme of the browser is changed. Thank you for pointing this out
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5402#discussion_r1888422552
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5402/review/2508722591 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241217/c92c5946/attachment.htm>
More information about the rails-dev
mailing list