]> source.dussan.org Git - gitea.git/commitdiff
Fix heatmap colors for Chrome/Safari (#5421)
authorLauris BH <lauris@nix.lv>
Wed, 28 Nov 2018 16:22:46 +0000 (18:22 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Nov 2018 16:22:46 +0000 (18:22 +0200)
public/js/index.js

index 6952cec7f6fb0518b7a6d27b782d03e9b0e91c2b..d65419f2ac1aa080483fd6f5dd8582959dd05cdc 100644 (file)
@@ -2363,8 +2363,13 @@ function initHeatmap(appElementId, heatmapUser, locale) {
             getColor: function(idx) {
                 var el = document.createElement('div');
                 el.className = 'heatmap-color-' + idx;
+                document.body.appendChild(el);
 
-                return getComputedStyle(el).backgroundColor;
+                var color = getComputedStyle(el).backgroundColor;
+
+                document.body.removeChild(el);
+
+                return color;
             }
         },