r86414 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86413‎ | r86414 | r86415 >
Date:17:05, 19 April 2011
Author:dale
Status:deferred
Tags:
Comment:
fixed compatibility issue with jQuery 1.4.4 with trigger
Modified paths:
  • /trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery/jquery.triggerQueueCallback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport/jquery/jquery.triggerQueueCallback.js
@@ -37,16 +37,21 @@
3838 var triggerNamespace = triggerName.split(".")[1];
3939 // Get the callback set
4040 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__'] ){
4244 // No events run the callback directly
4345 callback();
4446 return ;
4547 }
4648
 49+ var triggerEventSet = $( targetObject ).data( 'events' ) ?
 50+ $( targetObject ).data( 'events' )[ triggerBaseName ] :
 51+ $( targetObject).get(0)['__events__'][ 'events' ][ triggerBaseName ];
4752 if( ! triggerNamespace ){
48 - callbackSet = $( targetObject ).data( 'events' )[ triggerBaseName ];
 53+ callbackSet = triggerEventSet;
4954 } else{
50 - $j.each( $( targetObject ).data( 'events' )[ triggerBaseName ], function( inx, bindObject ){
 55+ $.each( triggerEventSet, function( inx, bindObject ){
5156 if( bindObject.namespace == triggerNamespace ){
5257 callbackSet.push( bindObject );
5358 }

Status & tagging log