No need to set returnValue if preventDefault exists. Thanks kangax for the catch.

This commit is contained in:
jeresig 2010-09-20 10:16:36 -04:00
parent 7350e2e1cc
commit be59693037

View file

@ -583,9 +583,11 @@ jQuery.Event.prototype = {
// if preventDefault exists run it on the original event // if preventDefault exists run it on the original event
if ( e.preventDefault ) { if ( e.preventDefault ) {
e.preventDefault(); e.preventDefault();
}
// otherwise set the returnValue property of the original event to false (IE) // otherwise set the returnValue property of the original event to false (IE)
e.returnValue = false; } else {
e.returnValue = false;
}
}, },
stopPropagation: function() { stopPropagation: function() {
this.isPropagationStopped = returnTrue; this.isPropagationStopped = returnTrue;