Page MenuHomePhabricator

mw.util.addPortletLink should only wrap link in <span> for "vectorTabs" portlets
Closed, ResolvedPublic

Description

By default, the function mw.util.addPortletLink wraps a link in <li><span></span></li>, when in fact, the only place where this is needed is in a vector tab.

Attached patch only wraps a link inside a span when it as placed in a menu with a vectorTabs class, resulting in a consistent DOM structure amongst different portlet in a menu section.


Version: 1.20.x
Severity: minor

Details

Reference
bz29567

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:32 PM
bzimport set Reference to bz29567.

Created attachment 8699
Patch for mediawiki.util.js

attachment mediawiki.util.js.patch ignored as obsolete

Created attachment 8700
Patch for mediawiki.util.js

Optimized code to only call .wrap once.

Attached:

Changing back to need-review because I changed the code while Krinkle reviewed the patch. Just going by the book...

Looks good, I'll adjust the test suite first to test for this, then apply the patch.

Tests introduced in r90728.

Bug fixed in r90729.