Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made sure that the correct event.taget is being used in event bubbling.

  • Loading branch information...
commit 67ded9a36a89c5fa1b1061c283dad078a59bec8e 1 parent 25885e0
@jeresig jeresig authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/unit/event.js
View
8 test/unit/event.js
@@ -203,10 +203,10 @@ test("trigger() bubbling", function() {
var doc = 0, html = 0, body = 0, main = 0, ap = 0;
- jQuery(document).bind("click", function(){ doc++; });
- jQuery("html").bind("click", function(){ html++; });
- jQuery("body").bind("click", function(){ body++; });
- jQuery("#main").bind("click", function(){ main++; });
+ jQuery(document).bind("click", function(e){ if ( e.target !== document) { doc++; } });
+ jQuery("html").bind("click", function(e){ html++; });
+ jQuery("body").bind("click", function(e){ body++; });
+ jQuery("#main").bind("click", function(e){ main++; });
jQuery("#ap").bind("click", function(){ ap++; return false; });
jQuery("html").trigger("click");
Please sign in to comment.
Something went wrong with that request. Please try again.