From d06ad98ec98490504c5520022cbb367396654ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 29 Oct 2018 04:19:45 -0700 Subject: [PATCH 1/2] Revert to sync loading of css, sometimes js loaded before css which caused issues --- public/views/index.template.html | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/public/views/index.template.html b/public/views/index.template.html index ced39d9af28..8b6d6a0775c 100644 --- a/public/views/index.template.html +++ b/public/views/index.template.html @@ -14,6 +14,9 @@ + + + @@ -253,14 +256,7 @@ navTree: [[.NavTree]] }; - // load css async - var myCSS = document.createElement("link"); - myCSS.rel = "stylesheet"; - myCSS.href = "public/build/grafana.[[ .Theme ]].css?v[[ .BuildVersion ]]+[[ .BuildCommit ]]"; - - // insert it at the end of the head in a legacy-friendly manner - document.head.insertBefore(myCSS, document.head.childNodes[document.head.childNodes.length - 1].nextSibling); - // switch loader to show all has loaded + // In case the js files fails to load the code below will show an info message. window.onload = function() { var preloader = document.getElementsByClassName("preloader"); if (preloader.length) { From 2dde2c4f9b4581c61f92f0a93e70844d9796033b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 29 Oct 2018 04:26:44 -0700 Subject: [PATCH 2/2] now that css is loaded sync again I can remove some styles from index html body css --- public/views/index.template.html | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/public/views/index.template.html b/public/views/index.template.html index 8b6d6a0775c..0717908c84c 100644 --- a/public/views/index.template.html +++ b/public/views/index.template.html @@ -26,13 +26,6 @@