HomePhabricator

Skin: Only load jquery.makeCollapsible if needed

Authored by Krinkle on Mar 8 2017, 4:48 AM.

Description

Skin: Only load jquery.makeCollapsible if needed

Currently, module 'jquery.makeCollapsible' is loaded on all pages
regarless of whether the page contains any collapsible elements.

It is required via 'mediawiki.page.ready'. Change this to lazy-loading
when needed only.

However, this lazy-load is discovered very late (after page ready,
after modules ready). To avoid regressing UX with an annoying reflow
of content and a very late hiding of collapsed elements, still
enqueue it in the main module loader by default on pages that
contain collapsible content server-side.

Bug: T159911
Change-Id: I4703ecd52d2d60207ba39108a4b3ef4aa1570965