Page MenuHomePhabricator

Make collapsible boxes more usable by having the whole header row clickable
Closed, InvalidPublic

Description

On zhwiki, an admin changed Template:HideH to the new jQuery.makeCollapsible from some home-made scripts in MediaWiki:Common.js. However this made some people uncomfortable because it is impossible to expand the box by clicking on the header row now but it used to be impossible. Although it's completely fine to restore the original one locally, I guess this can be a valid enhancement which may make this feature more usable.


Version: 1.18.x
Severity: normal

Details

Reference
bz31670

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:56 PM
bzimport set Reference to bz31670.
bzimport added a subscriber: Unknown Object (MLST).

s/it used to be impossible/it used to be possible/

Can conflict with sortable tables (also has entire header as sortdirection widget, and also with links in table headers which was actually initially a sortable tables bug)

This shouldn't be the default behavior.

It is, however, easily possible now, for example using constructs like this:

<div class="mw-collapsible" style="border: 1px solid grey;">
<div class="mw-collapsible-toggle" style="background: lightskyblue; text-align: center; float: none;">Header</div>
<div class="mw-collapsible-content">

  • Text
  • Text
  • Text

</div>
</div>

The entire blue "Header" area will be clickable and will toggle the "Text" content. More complicated layouts are possible, there's a gallery of examples (also serving as a test suite) at https://test.wikipedia.org/wiki/User:Krinkle/CollapsingTestpageMw (I'm afraid there is no full documentation anywhere, though).

I'm closing this bug as INVALID. Template creators: feel free to implement this on their wikis now and ask for help at MediaWiki-General IRC channel :)