From: Happy-melon Date: Thu, 23 Dec 2010 16:21:06 +0000 (+0000) Subject: Follow-up r78865 CR X-Git-Tag: 1.31.0-rc.0~33149 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=4de970d0f90a3b5a6c9882a287055b2dffec0bd9;p=lhc%2Fweb%2Fwiklou.git Follow-up r78865 CR --- diff --git a/resources/skins.common/skins.common.js b/resources/skins.common/skins.common.js index 8162f3d568..01153fb8bb 100644 --- a/resources/skins.common/skins.common.js +++ b/resources/skins.common/skins.common.js @@ -40,7 +40,7 @@ $('.collapsible').each( function(){ return false; }); } else { - $expander = $j('
') + var $expander = $j('
') .text( '[' + mediaWiki.msg( 'hide' ) + ']' ) .click(function(e, rmClass){ rmClass = !(rmClass == false); @@ -55,9 +55,8 @@ $('.collapsible').each( function(){ : mediaWiki.msg( 'hide' )) + ']' ); - return true; - }) - .before('[').after(']'); + return false; + }); if( $x.is('div.collapsible')){ $x.prepend($expander); } else { @@ -82,7 +81,7 @@ $('table.collapsible').live( 'mw-toggle-collapse', function(e, rmClass){ if( rmClass ){ $('table.collapsible',$(this)).andSelf().toggleClass('collapsed'); } - return true; + return false; }); $('div.collapsible').live( 'mw-toggle-collapse', function(e, rmClass){ @@ -93,7 +92,16 @@ $('div.collapsible').live( 'mw-toggle-collapse', function(e, rmClass){ if( rmClass ){ $('div.collapsible',$(this)).andSelf().toggleClass('collapsed'); } - return true; + return false; }); -$('.collapsible.collapsed .collapsible-expander').trigger( 'click', [false] ); \ No newline at end of file +/** + * Here we want to collapse .collapsible-expander buttons whose closest + * div.collapsible parent wants to be collapsed on first view + */ +$('.collapsible-expander').filter(function(){ + return $(this).closest('.collapsible').is('.collapsible.collapsed') +}).trigger( 'click', [false] ); + + +