From f17524bd0c8bc1b27760085d5afa6fc66ba208c6 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Wed, 28 Nov 2018 18:22:46 +0200 Subject: [PATCH] Fix heatmap colors for Chrome/Safari (#5421) --- public/js/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/index.js b/public/js/index.js index 6952cec7f6f..d65419f2ac1 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -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; } },