Page MenuHomePhabricator

Refactor: Move PHP logic into JS for collapsing tabs under more menu
Closed, ResolvedPublic

Description

SkinVector::getMenuData is made more complicated than it needs to be by the fact it uses logic to add a "collapsible" CSS class to all elements that can be collapsed under the more menu (all except the watch star).

However this CSS class is only needed with JavaScript! In fact a one it's just a one-liner $( '#p-views li' ).not( '#ca-watch, #ca-unwatch' ).addClass( 'collapsible' );

As a result I propose moving this logic to JS and removing the complicated PHP processing. This will also make it easier to upstream to core.

Event Timeline

Change 615316 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] Refactor: Replace PHP complexity with JS simplicity

https://gerrit.wikimedia.org/r/615316

Jdlrobson triaged this task as Medium priority.Jul 31 2020, 5:48 PM

Change 615316 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Refactor: Replace PHP complexity with JS simplicity

https://gerrit.wikimedia.org/r/615316

Jdlrobson claimed this task.