jquery.makeCollapsible: Clean up issues caused by wrong nesting
authorMatmaRex <matma.rex@gmail.com>
Sun, 10 Mar 2013 20:19:06 +0000 (21:19 +0100)
committerKrinkle <ttijhof@wikimedia.org>
Tue, 12 Mar 2013 12:03:46 +0000 (12:03 +0000)
commit2ebbdbebec347c4f029b90e578f8d03034478794
tree9a531bbbf7f6bafeefe13b9d3a3ce03ec23d17c5
parentd48157860e7db5ed884cf165b8b8416c3e93ffdd
jquery.makeCollapsible: Clean up issues caused by wrong nesting

The way it was done - switching first on action (expand/collapse), then on
elements - caused the logic to be split all over the file.

This caused:
* code duplication (e.g. computing the elements to be acted upon in
  the same way for expanding and collapsing, repeated same comments)
* regressions when the logic was changed for one but not for the other
  (this was the case e.g. with table expanding/collapsing).

As for the second, I fixed all spotted inconsistencies; as for the
first, I'll let the diffstat speak for itself.

Change-Id: I2d2592b4d00424f0c23c493f6de6c824d0714dfc
resources/jquery/jquery.makeCollapsible.js