* Toggle entire element if no .mw-collapsible-content is found
authorKrinkle <krinkle@users.mediawiki.org>
Sun, 2 Jan 2011 04:46:44 +0000 (04:46 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Sun, 2 Jan 2011 04:46:44 +0000 (04:46 +0000)
commit8fad46e6add5d9de10606e8acf519d443ca85848
tree361b99226955271f0e21c3db1e5931134b566ca0
parentdcc3dae441815422e4647e1774b45a7a7e571ad9
* Toggle entire element if no .mw-collapsible-content is found
* Bug fixed in which a single customtoggle should trigger multiple customcollapsible elements

If no .mw-collapsible-content element is found when the toggleElement() function is called, assume that the user wants the mw-collapsible itself to be toggled. This enables custom use with table rows (in which we dont want something inside to toggle but the entire table row) - with a remote toggle.

This change makes it possible to have a togglable table-row.

The intial "collapsed" state for a mw-customtoggle is no longer executed by performing a click on the mw-customtoggle. Instead by calling the toggle function directly.
Reason being that an mw-customtoggle could have any number of special functions bound to it (be it the function to toggle another mw-customcollapsible, or perhaps a totally different function).

I considered using this method for 'normal' default togglers as well. However default togglers have more actions involved aside from just 'toggling' the element. Namely changing the innerText to the localized message and swapping classes. Those stay as they are by simply simulating a click() event on them (if the initial state should be collapsed).
resources/jquery/jquery.makeCollapsible.js