Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery/jquery.triggerQueueCallback.js |
— | — | @@ -37,16 +37,21 @@ |
38 | 38 | var triggerNamespace = triggerName.split(".")[1]; |
39 | 39 | // Get the callback set |
40 | 40 | var callbackSet = []; |
41 | | - if( !$( targetObject ).data( 'events' ) ){ |
| 41 | + |
| 42 | + // Check for both jQuery 1.4.4 events location and other jQuery data location: |
| 43 | + if( !$( targetObject ).data( 'events' ) && ! $( targetObject).get(0)['__events__'] ){ |
42 | 44 | // No events run the callback directly |
43 | 45 | callback(); |
44 | 46 | return ; |
45 | 47 | } |
46 | 48 | |
| 49 | + var triggerEventSet = $( targetObject ).data( 'events' ) ? |
| 50 | + $( targetObject ).data( 'events' )[ triggerBaseName ] : |
| 51 | + $( targetObject).get(0)['__events__'][ 'events' ][ triggerBaseName ]; |
47 | 52 | if( ! triggerNamespace ){ |
48 | | - callbackSet = $( targetObject ).data( 'events' )[ triggerBaseName ]; |
| 53 | + callbackSet = triggerEventSet; |
49 | 54 | } else{ |
50 | | - $j.each( $( targetObject ).data( 'events' )[ triggerBaseName ], function( inx, bindObject ){ |
| 55 | + $.each( triggerEventSet, function( inx, bindObject ){ |
51 | 56 | if( bindObject.namespace == triggerNamespace ){ |
52 | 57 | callbackSet.push( bindObject ); |
53 | 58 | } |