Просмотр исходного кода

Decides whether to use analytics after the analytics API has been given a chance to load.

master
Lyubomir Marinov 10 лет назад
Родитель
Сommit
ec954ad3cc
1 измененных файлов: 5 добавлений и 1 удалений
  1. 5
    1
      modules/statistics/AnalyticsAdapter.js

+ 5
- 1
modules/statistics/AnalyticsAdapter.js Просмотреть файл

@@ -1,3 +1,5 @@
1
+/* global config */
2
+
1 3
 var ScriptUtil = require('../util/ScriptUtil');
2 4
 
3 5
 // Load the integration of a third-party analytics API such as Google Analytics.
@@ -33,7 +35,9 @@ AnalyticsAdapter.prototype.sendEvent = function (action, data) {
33 35
   var a = this.analytics;
34 36
 
35 37
   if (a === null || typeof a === 'undefined') {
36
-      this.analytics = a = new (window.Analytics || NoopAnalytics)();
38
+      var AnalyticsImpl = window.Analytics || NoopAnalytics;
39
+
40
+      this.analytics = a = new AnalyticsImpl();
37 41
   }
38 42
   try {
39 43
       a.sendEvent.apply(a, arguments);

Загрузка…
Отмена
Сохранить