Skip to content

Commit

Permalink
Fix to gracefully handle a tags without hrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
Subbu Balakrishnan committed Mar 7, 2018
1 parent 7500e19 commit bf481b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
10 changes: 6 additions & 4 deletions dist/keen-tracking.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/keen-tracking.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/helpers/getDomNodeProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function getDomNodeProfile(el) {
return {
action: el.action,
class: el.className,
href: el.href,
href: el.href || null,
id: el.id,
method: el.method,
name: el.name,
Expand Down
8 changes: 5 additions & 3 deletions lib/utils/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ function deferClickEvent(evt, anchor, callback){
evt.preventDefault();
}
evt.returnValue = false;
setTimeout(function(){
window.location = anchor.href;
}, timeout);
if (anchor.href) {
setTimeout(function(){
window.location = anchor.href;
}, timeout);
}
}

return false;
Expand Down

0 comments on commit bf481b5

Please sign in to comment.