"Schnark" posted a comment on MediaWiki.r104671.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/104671#c26836

Commit summary for MediaWiki.r104671:

(bug 31212) History tab not collapsed when the screen is narrow. Patch by 
Michael M

Schnark's comment:

Now after a closer look I understand what's going on:
Once (jQuery 1.4.2, 
[http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/jquery/jquery.js?revision=72349&view=markup#l2361])
 $.bind checked for <code>jQuery.isFunction( data )</code> to see if the 
arguments needed to be shifted, and all worked as expected.

But with jQuery 1.6.2 
([http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/jquery/jquery.js?revision=91845&view=markup#l3427])
 this check is now <code>arguments.length === 2</code> which is false, since 
there are always 3 arguments, even if the last argument is 
<code>undefined</code>.

A probably better solution than my original patch would of course be to fix the 
delayedBind-plugin. I neither can test javascript code nor can I created 
patches right now, but I think something like

 if ( callback === undefined ) {
  $(this).bind( '_delayedBind-' + encEvent + '-' + timeout, data );
 } else {
  $(this).bind( '_delayedBind-' + encEvent + '-' + timeout, data, callback );
 }

instead of 
[http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/jquery/jquery.delayedBind.js?revision=81264&view=markup#l42
 line 42] should work.

Or just write in the documentation that <code>data</code> isn't optional any 
more ...

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to