Fix #13255. Set a default event target for Cordova.

This commit is contained in:
Dave Methvin 2013-05-02 13:39:13 -04:00
parent 9c4a428528
commit 6b5391508e

View 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 ) {