track settings changes via events

10.3.x-maintenance
cTn 2014-11-20 19:29:43 +01:00
parent b7e6f66a3d
commit 12a99fa4b5
1 changed files with 5 additions and 3 deletions

View File

@ -148,13 +148,14 @@ $(document).ready(function () {
// if notifications are enabled, or wasn't set, check the notifications checkbox // if notifications are enabled, or wasn't set, check the notifications checkbox
chrome.storage.local.get('update_notify', function (result) { chrome.storage.local.get('update_notify', function (result) {
if (result.update_notify === 'undefined' || result.update_notify) { if (typeof result.update_notify === 'undefined' || result.update_notify) {
$('div.notifications input').prop('checked', true); $('div.notifications input').prop('checked', true);
} }
}); });
$('div.notifications input').change(function () { $('div.notifications input').change(function () {
var check = $(this).is(':checked'); var check = $(this).is(':checked');
googleAnalytics.sendEvent('Settings', 'Notifications', check);
chrome.storage.local.set({'update_notify': check}); chrome.storage.local.set({'update_notify': check});
}); });
@ -165,8 +166,9 @@ $(document).ready(function () {
} }
$('div.statistics input').change(function () { $('div.statistics input').change(function () {
var result = $(this).is(':checked'); var check = $(this).is(':checked');
googleAnalyticsConfig.setTrackingPermitted(result); googleAnalytics.sendEvent('Settings', 'GoogleAnalytics', check);
googleAnalyticsConfig.setTrackingPermitted(check);
}); });
function close_and_cleanup(e) { function close_and_cleanup(e) {