(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