Page MenuHomePhabricator

Make selected table rows collapsible with .mw-collapsible-content
Open, LowPublic

Description

jquery.makeCollapsible.js

Mediawiki syntax makes it possible to add classes to table rows (but not list items, for instance).

I would expect

{| class="mw-collapsible"
|+ Caption
|- 
| always visible
|- class="mw-collapsible-content"
| hidden when collapsed
|}

and

{| class="mw-collapsible"
! Header
|- 
| always visible
|- class="mw-collapsible-content"
| hidden when collapsed
|}

to work much the same as

<div class="mw-collapsible">
  always visible
  <div class="mw-collapsible-content">
    hidden when collapsed
  </div>
</div>

Event Timeline

TheDJ subscribed.

The demo page actually demonstrates this, I wonder if it broke at some point...

@TheDJ Where?

class="mw-collapsible-content" has always only worked when the parent with class="mw-collapsible" is not a <table> or <ul>/<ol> – tables and lists are special-cased and don't support this.

@matmarex the example: Custom collapsible 4 (table-row)
that page was Timo's original sandbox/playground when mw-collapsible was being worked on. I'm not sure if it was just an experiment, or if it is something that was scratched during development, or just junk. Just happened to spot that while investigating customcollapsible behavior the other day, but didn't have time to do a full blame of all the code.

Hmm. wait.. why does mediawiki.org version have different behavior from my imported local version...

Oh, right. That is implemented differently though. Each row is a separate collapsible, and they all use the same custom toggle.