Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
don't preventDefault on links
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Aug 3, 2017
1 parent 09cc047 commit 1d688bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
10 changes: 2 additions & 8 deletions frontend/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ $(document).ready(function() {
$('.send-new').attr('href', window.location.origin);

$('.send-new').click(function(target) {
target.preventDefault();
sendEvent('recipient', 'restarted', {
cd2: 'completed'
}).then(() => {
location.href = target.currentTarget.href;
});
})
});

$('.legal-links a, .social-links a, #dl-firefox').click(function(target) {
target.preventDefault();
const metric = findMetric(target.currentTarget.href);
// record exited event by recipient
sendEvent('recipient', 'exited', {
cd3: metric
}).then(() => {
location.href = target.currentTarget.href;
});
})
});

const filename = $('#dl-filename').text();
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,25 @@ $(document).ready(function() {
$('#file-upload').change(onUpload);

$('.legal-links a, .social-links a, #dl-firefox').click(function(target) {
target.preventDefault();
const metric = findMetric(target.currentTarget.href);
// record exited event by recipient
sendEvent('sender', 'exited', {
cd3: metric
}).then(() => {
location.href = target.currentTarget.href;
});
});

$('#send-new-completed').click(function(target) {
target.preventDefault();
// record restarted event
sendEvent('sender', 'restarted', {
cd2: 'completed'
}).then(() => {
storage.referrer = 'completed-upload';
location.href = target.currentTarget.href;
});
});

$('#send-new-error').click(function(target) {
target.preventDefault();
// record restarted event
storage.referrer = 'errored-upload';
sendEvent('sender', 'restarted', {
cd2: 'errored'
}).then(() => {
storage.referrer = 'errored-upload';
location.href = target.currentTarget.href;
});
});

Expand Down

0 comments on commit 1d688bf

Please # to comment.