(bug 34876) Make jquery.makeCollapsible less slow.
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 29 Aug 2012 12:31:10 +0000 (14:31 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 9 Oct 2012 05:44:51 +0000 (05:44 +0000)
commit287331a04ec3c45fddb2e522dd8d5819f5cafb93
tree8d24baaa5a2fe94158c95675bbf0b998d543d848
parent16105b1859b7a8cc4c30cba52fc6bad9ea335265
(bug 34876) Make jquery.makeCollapsible less slow.

Several optimisations:

* Re-using the same $collapsible jQuery object instead of
  re-creation of $(this).
* Use .data instead of dom manipulation (className property).
* Use $.nodeName( HTMLElement, tag ) to check something is <a>,
  instead of using creating a jQuery object and calling
  "is.('a')", which goes through a lot of selector stuff.
- Fix bug where it says it does instantHide but actually still
  triggers the event that causes initial animations.

Thanks to Lupo for most of these ideas, based on this patch:
 * https://bugzilla.wikimedia.org/attachment.cgi?id=10200

Verified that these test cases all still work:
 https://test.wikipedia.org/wiki/User:Krinkle/CollapsingTestpageMw

(copy wikitext to localhost)

Change-Id: Idb9ca00c03ec7d70903ed7fd79e427efa270ace4
RELEASE-NOTES-1.21
resources/jquery/jquery.makeCollapsible.js