Index: trunk/phase3/resources/skins.common/skins.common.js |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | return false; |
42 | 42 | }); |
43 | 43 | } else { |
44 | | - $expander = $j('<div class="collapsible-expander">') |
| 44 | + var $expander = $j('<div class="collapsible-expander">') |
45 | 45 | .text( '[' + mediaWiki.msg( 'hide' ) + ']' ) |
46 | 46 | .click(function(e, rmClass){ |
47 | 47 | rmClass = !(rmClass == false); |
— | — | @@ -55,9 +55,8 @@ |
56 | 56 | : mediaWiki.msg( 'hide' )) + |
57 | 57 | ']' |
58 | 58 | ); |
59 | | - return true; |
60 | | - }) |
61 | | - .before('[').after(']'); |
| 59 | + return false; |
| 60 | + }); |
62 | 61 | if( $x.is('div.collapsible')){ |
63 | 62 | $x.prepend($expander); |
64 | 63 | } else { |
— | — | @@ -82,7 +81,7 @@ |
83 | 82 | if( rmClass ){ |
84 | 83 | $('table.collapsible',$(this)).andSelf().toggleClass('collapsed'); |
85 | 84 | } |
86 | | - return true; |
| 85 | + return false; |
87 | 86 | }); |
88 | 87 | |
89 | 88 | $('div.collapsible').live( 'mw-toggle-collapse', function(e, rmClass){ |
— | — | @@ -93,7 +92,16 @@ |
94 | 93 | if( rmClass ){ |
95 | 94 | $('div.collapsible',$(this)).andSelf().toggleClass('collapsed'); |
96 | 95 | } |
97 | | - return true; |
| 96 | + return false; |
98 | 97 | }); |
99 | 98 | |
100 | | -$('.collapsible.collapsed .collapsible-expander').trigger( 'click', [false] ); |
\ No newline at end of file |
| 99 | +/** |
| 100 | + * Here we want to collapse .collapsible-expander buttons whose closest |
| 101 | + * div.collapsible parent wants to be collapsed on first view |
| 102 | + */ |
| 103 | +$('.collapsible-expander').filter(function(){ |
| 104 | + return $(this).closest('.collapsible').is('.collapsible.collapsed') |
| 105 | +}).trigger( 'click', [false] ); |
| 106 | + |
| 107 | + |
| 108 | + |