diff --git a/frontend-js/src/main/js/minerva.js b/frontend-js/src/main/js/minerva.js index 2d5bf4c2d19e95f656c41b5363490678c8bf4163..81f69dcf9c53282f3624061b2a355ad94a3dee4c 100644 --- a/frontend-js/src/main/js/minerva.js +++ b/frontend-js/src/main/js/minerva.js @@ -54,29 +54,27 @@ function processUrlGetParams(params) { } function insertGoogleAnalyticsCode() { - return new Promise(function(resolve) { - return ServerConnector.getConfigurationParam(ConfigurationType.GOOGLE_ANALYTICS_IDENTIFIER).then( - function(identifier) { - if (identifier === "" || identifier === undefined || identifier === null) { - resolve(); - } else { - global._gaq = global._gaq || []; - global._gaq.push([ '_setAccount', identifier ]); - global._gaq.push([ '_trackPageview' ]); - - (function() { - var ga = document.createElement('script'); - ga.type = 'text/javascript'; - ga.async = true; - ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') - + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; - s.parentNode.insertBefore(ga, s); - })(); - resolve(); - } - }); - }); + return ServerConnector.getConfigurationParam(ConfigurationType.GOOGLE_ANALYTICS_IDENTIFIER).then( + function(identifier) { + if (identifier === "" || identifier === undefined || identifier === null) { + return; + } else { + global._gaq = global._gaq || []; + global._gaq.push([ '_setAccount', identifier ]); + global._gaq.push([ '_trackPageview' ]); + + (function() { + var ga = document.createElement('script'); + ga.type = 'text/javascript'; + ga.async = true; + ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(ga, s); + })(); + return; + } + }); } function createDivStructure(element) { element.style.display = "table"; @@ -241,7 +239,7 @@ function create(params) { if (submodelId !== undefined) { result.openSubmodel(submodelId); } - + if (params.isDebug()) { global.leftPanel = leftPanel; }