]> source.dussan.org Git - jquery.git/commitdiff
No need to set returnValue if preventDefault exists. Thanks kangax for the catch.
authorjeresig <jeresig@gmail.com>
Mon, 20 Sep 2010 14:16:36 +0000 (10:16 -0400)
committerjeresig <jeresig@gmail.com>
Mon, 20 Sep 2010 14:16:36 +0000 (10:16 -0400)
src/event.js

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