Skip to content

Commit f47592c

Browse files
fixed analytics recording graph expand on startup
related commit: 28c9476
1 parent 940ef4b commit f47592c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

js/app.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,18 +328,25 @@ $(window).ready(function() {
328328

329329
$('#telemetry_graph').on('click', '.graph_label', function() {
330330
var e = $(this);
331+
var analytics = true;
332+
333+
if(e.hasClass("noanalytics")) {
334+
analytics = false;
335+
e.removeClass("noanalytics");
336+
}
337+
331338
if(e.hasClass('active')) {
332339
e.removeClass('active');
333340
var h = $('#map').height() + $('#telemetry_graph').height();
334341

335342
//analytics
336-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI', 'Collapse', 'Telemetry Graph']);
343+
if(typeof _gaq == 'object' && analytics) _gaq.push(['_trackEvent', 'UI', 'Collapse', 'Telemetry Graph']);
337344
} else {
338345
e.addClass('active');
339346
var h = $('#map').height() - $('#telemetry_graph').height();
340347

341348
//analytics
342-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI', 'Expand', 'Telemetry Graph']);
349+
if(typeof _gaq == 'object' && analytics) _gaq.push(['_trackEvent', 'UI', 'Expand', 'Telemetry Graph']);
343350
}
344351
$('#map').stop(null,null).animate({'height': h}, function() {
345352
if(map) google.maps.event.trigger(map, 'resize');

js/tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ function zoom_on_payload() {
13621362
listScroll.scrollToElement('.portrait .vehicle'+i);
13631363

13641364
// expand graph on startup, if nessary
1365-
if(embed.graph_expanded && !is_mobile) $('#telemetry_graph .graph_label').click();
1365+
if(embed.graph_expanded && !is_mobile) $('#telemetry_graph .graph_label').addClass("noanalytics").click();
13661366
}
13671367

13681368
function isInt(n) {

0 commit comments

Comments
 (0)