aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2010-12-27 12:43:48 -0500
committerDave Methvin <dave.methvin@gmail.com>2010-12-27 12:43:48 -0500
commitb8931f744859e598aad52140d8ca085e013ac798 (patch)
tree7bc7daa003d6153c28ec894d4f1ac884ef8f9593 /test
parentc9e8a95709e12c6838a312850ce645e96a53ff5d (diff)
downloadjquery-b8931f744859e598aad52140d8ca085e013ac798.tar.gz
jquery-b8931f744859e598aad52140d8ca085e013ac798.zip
Test for standard createEvent before IE-specific click method.
Don't fallback to fake click; let's see which browsers fail, if any.
Diffstat (limited to 'test')
-rw-r--r--test/unit/event.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index d0183f89d..56bc64ff6 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -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) {