Simplify the check for isDefaultPrevented.

This commit is contained in:
Dave Methvin 2010-12-24 09:53:39 -05:00
parent 0b6afcedd2
commit c9e8a95709

View File

@ -602,10 +602,8 @@ jQuery.Event = function( src ) {
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented =
(src.defaultPrevented===true ? true :
src.getPreventDefault ? src.getPreventDefault() :
src.returnValue===false) ? returnTrue : returnFalse;
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;