]> source.dussan.org Git - jquery.git/commitdiff
Fix #13255. Set a default event target for Cordova.
authorDave Methvin <dave.methvin@gmail.com>
Thu, 2 May 2013 17:39:13 +0000 (13:39 -0400)
committerDave Methvin <dave.methvin@gmail.com>
Thu, 2 May 2013 17:39:13 +0000 (13:39 -0400)
src/event.js

index 97a408839b54ca72e3b6ac88d1deeb6c03976914..9262d1d6d4a928416644a13d5f8f5eea6229ad53 100644 (file)
@@ -511,6 +511,12 @@ jQuery.event = {
                        event[ prop ] = originalEvent[ prop ];
                }
 
+               // Support: Cordova 2.5 (WebKit) (#13255)
+               // All events should have a target; Cordova deviceready doesn't
+               if ( !event.target ) {
+                       event.target = document;
+               }
+
                // Support: Safari 6.0+, Chrome < 28
                // Target should not be a text node (#504, #13143)
                if ( event.target.nodeType === 3 ) {