Skip to content
Permalink
Browse files
Test for standard createEvent before IE-specific click method.
Don't fallback to fake click; let's see which browsers fail, if any.
  • Loading branch information
dmethvin committed Dec 27, 2010
1 parent c9e8a95 commit b8931f7
Showing 1 changed file with 4 additions and 7 deletions.
@@ -300,17 +300,14 @@ test("bind/delegate bubbling, isDefaultPrevented", function() {
var $anchor2 = jQuery( "#anchor2" ),
$main = jQuery( "#main" ),
fakeClick = function($jq) {
// Prefer a native click so we don't get jQuery simulated bubbling
if ( $jq[0].click ) {
$jq[0].click(); // IE
}
else if ( document.createEvent ) {
// Use a native click so we don't get jQuery simulated bubbling
if ( document.createEvent ) {
var e = document.createEvent( 'MouseEvents' );
e.initEvent( "click", true, true );
$jq[0].dispatchEvent(e);
}
else {
$jq.click();
else if ( $jq[0].click ) {
$jq[0].click(); // IE
}
};
$anchor2.click(function(e) {

0 comments on commit b8931f7

Please sign in to comment.