Skip to content
Permalink
Browse files

Simplify the check for isDefaultPrevented.

  • Loading branch information...
dmethvin committed Dec 24, 2010
1 parent 0b6afce commit c9e8a95709e12c6838a312850ce645e96a53ff5d
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/event.js
@@ -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;

0 comments on commit c9e8a95

Please sign in to comment.
You can’t perform that action at this time.