Skip to content
Snippets Groups Projects
Commit 93da71d9 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unnecessary promise removed

parent 380e00f9
No related branches found
No related tags found
1 merge request!5Frontend refactor
...@@ -54,29 +54,27 @@ function processUrlGetParams(params) { ...@@ -54,29 +54,27 @@ function processUrlGetParams(params) {
} }
function insertGoogleAnalyticsCode() { function insertGoogleAnalyticsCode() {
return new Promise(function(resolve) { return ServerConnector.getConfigurationParam(ConfigurationType.GOOGLE_ANALYTICS_IDENTIFIER).then(
return ServerConnector.getConfigurationParam(ConfigurationType.GOOGLE_ANALYTICS_IDENTIFIER).then( function(identifier) {
function(identifier) { if (identifier === "" || identifier === undefined || identifier === null) {
if (identifier === "" || identifier === undefined || identifier === null) { return;
resolve(); } else {
} else { global._gaq = global._gaq || [];
global._gaq = global._gaq || []; global._gaq.push([ '_setAccount', identifier ]);
global._gaq.push([ '_setAccount', identifier ]); global._gaq.push([ '_trackPageview' ]);
global._gaq.push([ '_trackPageview' ]);
(function() {
(function() { var ga = document.createElement('script');
var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.type = 'text/javascript'; ga.async = true;
ga.async = true; ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www')
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0];
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
s.parentNode.insertBefore(ga, s); })();
})(); return;
resolve(); }
} });
});
});
} }
function createDivStructure(element) { function createDivStructure(element) {
element.style.display = "table"; element.style.display = "table";
...@@ -241,7 +239,7 @@ function create(params) { ...@@ -241,7 +239,7 @@ function create(params) {
if (submodelId !== undefined) { if (submodelId !== undefined) {
result.openSubmodel(submodelId); result.openSubmodel(submodelId);
} }
if (params.isDebug()) { if (params.isDebug()) {
global.leftPanel = leftPanel; global.leftPanel = leftPanel;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment