diff --git a/src/event.js b/src/event.js
index d4a899bdd..7c718f48a 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") ) {
diff --git a/test/unit/event.js b/test/unit/event.js
index 47da9b698..e1a95497d 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -31,9 +31,9 @@ test("bind()", function() {
// var doc = document.getElementById("iframe").contentDocument;
//
// doc.body.innerHTML = "";
- //
+ //
// var input = doc.getElementsByTagName("input")[0];
- //
+ //
// $(input).bind("click",function() {
// ok( true, "Binding to element inside iframe" );
// }).click();
@@ -48,34 +48,34 @@ test("bind()", function() {
reset();
- $("#firstp").bind("click",function(e){
+ $("#firstp").bind("click",function(e){
ok(true, "Normal click triggered");
- });
+ });
- $("#firstp").bind("click.test",function(e){
+ $("#firstp").bind("click.test",function(e){
ok(true, "Namespaced click triggered");
- });
+ });
// Trigger both bound fn (2)
- $("#firstp").trigger("click");
+ $("#firstp").trigger("click");
// Trigger one bound fn (1)
- $("#firstp").trigger("click.test");
+ $("#firstp").trigger("click.test");
// Remove only the one fn
- $("#firstp").unbind("click.test");
+ $("#firstp").unbind("click.test");
// Trigger the remaining fn (1)
- $("#firstp").trigger("click");
+ $("#firstp").trigger("click");
});
test("click()", function() {
expect(4);
$('