Skip to content

Commit

Permalink
added jquery.on for future event delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-coates committed Jul 11, 2012
1 parent 4f8e23c commit 1f67081
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions jquery.analyticseventtracking.js
Expand Up @@ -17,13 +17,11 @@
},
methods = {
init: function(settings) {
this.each(function() {
$(this).click(function(event) {
if (settings.delayed === true && $(this).attr("href")) {
event.preventDefault();
}
methods.trackEvent.call($(this), settings);
});
$(document).on('click', this.selector, function(event) {
if (settings.delayed === true && $(this).attr("href")) {
event.preventDefault();
}
methods.trackEvent.call($(this), settings);
});
},
getData: function(name, elm, defaultData) {
Expand Down

0 comments on commit 1f67081

Please sign in to comment.