Last modified: 2013-07-06 23:11:29 UTC
1) Add to [[Wikipedia:Sandbox]] the following code (e.g.: https://en.wikipedia.org/?oldid=481562172): <div id="foo-bar" style="display:none;"> {| class="wikitable mw-collapsible mw-collapsed" |- !A||B |- |C||D |} </div> 2) Add to [[Special:MyPage/common.js]] the script below (e.g.: https://en.wikipedia.org/?oldid=481560711) $( mw.util.addPortletLink( 'p-namespaces', '#', 'Test now!' ) ).click( function ( e ) { $('#foo-bar').show(); } ); 3) Open the sandbox and click on "Test now!" 4) It will appear a table like this: +----------------+ | A | B [expand] | +----------------+ | C | D | +----------------+ 5) Click on "[expand]" and the same table will be displayed, but now with the "[collapse]" button: +------------------+ | A | B [collapse] | +------------------+ | C | D | +------------------+ 6) Click on "[collapse]" and it will appear a collapsed table like this: +----------------+ | A | B [expand] | +----------------+ As you can see, although we added the class "mw-collapsed" and the button in the table from (4) says "expand", the table is not collapsed!
Confirmed. Note that this appears to be corrected with the rewritten jquery.makeCollapsible() attached to bug 34876 as attachment 10193 [details] (with the patch in attachment 10234 [details] applied).
I can no longer reproduce this using the steps provided – the table is correctly collapsed when shown with the "Test now!" link. The $.makeCollapsible script has been largely rewritten since the time of the report, I think.
Indeed. On step 4 I get a table like this: +----------------+ | A | B [expand] | +----------------+