From: John Resig Date: Tue, 28 Aug 2007 04:34:23 +0000 (+0000) Subject: Made it so that the last return value is always returned from handle() (unless one... X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=25e83d27cb20ba8aa5dec7fec2d05e4da52d9fee;hp=127c0b8a5d9ab35f9f0b91688a8ff7df45244977;p=jquery.git Made it so that the last return value is always returned from handle() (unless one of the return values was false, in which case the return value is false). (Bug #1416) --- diff --git a/src/event/event.js b/src/event/event.js index a4a99d9..7f0ec64 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -170,10 +170,14 @@ jQuery.event = { args[0].handler = c[j]; args[0].data = c[j].data; - if ( c[j].apply( this, args ) === false ) { + var tmp = c[j].apply( this, args ); + + if ( val !== false ) + val = tmp; + + if ( tmp === false ) { event.preventDefault(); event.stopPropagation(); - val = false; } }