Bug Tracker

Ticket #3096: event-extra.patch

File event-extra.patch, 1.9 kB (added by scott.gonzalez, 7 months ago)
  • test/unit/event.js

     
    182182}); 
    183183 
    184184test("trigger(event, [data], [fn])", function() { 
    185     expect(67); 
     185    expect(72); 
    186186 
    187187    var handler = function(event, a, b, c) { 
    188188        equals( event.type, "click", "check passed data" ); 
     
    192192        return "test"; 
    193193    }; 
    194194 
    195     var handler2 = function(a, b, c) { 
     195    var handler2 = function(event, a, b, c) { 
     196        equals( event.type, "click", "check passed data" ); 
    196197        equals( a, 1, "check passed data" ); 
    197198        equals( b, "2", "check passed data" ); 
    198199        equals( c, "abc", "check passed data" ); 
    199200        return false; 
    200201    }; 
    201202 
    202     var handler3 = function(a, b, c, v) { 
     203    var handler3 = function(event, a, b, c, v) { 
     204        equals( event.type, "click", "check passed data" ); 
    203205        equals( a, 1, "check passed data" ); 
    204206        equals( b, "2", "check passed data" ); 
    205207        equals( c, "abc", "check passed data" ); 
     
    207209        return "newVal"; 
    208210    }; 
    209211 
    210     var handler4 = function(a, b, c, v) { 
     212    var handler4 = function(event, a, b, c, v) { 
     213        equals( event.type, "click", "check passed data" ); 
    211214        equals( a, 1, "check passed data" ); 
    212215        equals( b, "2", "check passed data" ); 
    213216        equals( c, "abc", "check passed data" ); 
  • src/event.js

     
    206206            if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) 
    207207                val = false; 
    208208 
    209             // Extra functions don't get the custom event object 
    210             if ( event ) 
    211                 data.shift(); 
    212  
    213209            // Handle triggering of extra function 
    214210            if ( extra && jQuery.isFunction( extra ) ) { 
    215211                // call the extra function and tack the current return value on the end for possible inspection