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) {
}
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;
}
......
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