From ad97f1f18b6f3b2446e26e56c3d5ca02d5415474 Mon Sep 17 00:00:00 2001
From: sherzinger <sascha.herzinger@uni.lu>
Date: Fri, 1 Mar 2019 09:49:59 +0100
Subject: [PATCH] moved fix to more appropriate place

---
 frontend-js/src/main/js/minerva.js | 11 -----------
 web/src/main/webapp/index.xhtml    | 12 ++++++++++++
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/frontend-js/src/main/js/minerva.js b/frontend-js/src/main/js/minerva.js
index 98dfa93364..4c3a1d5f82 100644
--- a/frontend-js/src/main/js/minerva.js
+++ b/frontend-js/src/main/js/minerva.js
@@ -35,17 +35,6 @@ var Functions = require('./Functions');
 
 var customMap, leftPanel, topMenu, legend, mapContextMenu, selectionContextMenu;
 
-/**
- * Safari has some issue with the jquery css or the way JSF presents the CSS resources.
- * This is a hack that fixes this issue by forcing the icon sprite png to be loaded once the document is ready.
- */
-$('document').ready(function() {
-  var style = document.createElement("style");
-  var styleText = document.createTextNode(".ui-icon { background-image: url(/minerva/javax.faces.resource/images/ui-icons_616161_256x240.png.xhtml?ln=primefaces-aristo&m_version=Unknown) !important; }");
-  style.appendChild(styleText);
-  document.head.appendChild(style);
-});
-
 /**
  *
  * @param {CustomMapOptions} params
diff --git a/web/src/main/webapp/index.xhtml b/web/src/main/webapp/index.xhtml
index 59e7efe6cb..6d5cebeff4 100644
--- a/web/src/main/webapp/index.xhtml
+++ b/web/src/main/webapp/index.xhtml
@@ -35,6 +35,18 @@
 			var btn = $.fn.button.noConflict(); // reverts $.fn.button to jqueryui btn
 			$.fn.btn = btn; // assigns bootstrap button functionality to $.fn.btn
 
+			/**
+			 * Safari has some issue with the jquery css or the way JSF presents the CSS resources.
+			 * This is a hack that fixes this issue by forcing the icon sprite png to be loaded once the document is ready.
+			 */
+			$('document').ready(function() {
+				console.log('hi');
+				var style = document.createElement("style");
+				var styleText = document.createTextNode(".ui-icon { background-image: url(/minerva/javax.faces.resource/images/ui-icons_616161_256x240.png.xhtml?ln=primefaces-aristo&m_version=Unknown) !important; }");
+				style.appendChild(styleText);
+				document.head.appendChild(style);
+			});
+
 			function initMap(){
 				var element = document.getElementById('minervaAppDiv');
 				return minerva.create({
-- 
GitLab