X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fevent.js;h=7c718f48a49b03daa2b109449c9ca04156597f05;hb=66fbbec3bb2d0555da55eea4abae0081484d37b4;hp=6475cd925a289aad5ff95d16dac232ddcd7e814b;hpb=b26da08821ef07860b489ea2450f672ea155ca88;p=jquery.git diff --git a/src/event.js b/src/event.js index 6475cd9..7c718f4 100644 --- a/src/event.js +++ b/src/event.js @@ -171,8 +171,13 @@ jQuery.event = { data.shift(); // Handle triggering of extra function - if ( extra && extra.apply( element, data ) === false ) - val = false; + if ( extra ) { + // call the extra function and tack the current return value on the end for possible inspection + var ret = extra.apply( element, data.concat( val ) ); + // if anything is returned, give it precedence and have it overwrite the previous value + if (ret !== undefined) + val = ret; + } // Trigger the native events (except for clicks on links) if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) { @@ -333,7 +338,7 @@ jQuery.fn.extend({ event.preventDefault(); // and execute the function - return args[this.lastToggle].apply( this, [event] ) || false; + return args[this.lastToggle].apply( this, arguments ) || false; }); },