Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6172348
menuTabs.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
842 B
Referenced Files
None
Subscribers
None
menuTabs.js
View Options
const
TABS_SELECTOR
=
'.vector-menu-tabs'
,
LIST_ITEM_JS_SELECTOR
=
'.mw-list-item-js'
,
NO_ICON_CLASS
=
'vector-tab-noicon'
;
/**
* T320691: Add a `.vector-tab-noicon` class to any tabbed menu item that is
* added by a gadget so that the menu item has the correct padding and margin.
*
* @param {HTMLElement} item
*/
function
addNoIconClass
(
item
)
{
item
.
classList
.
add
(
NO_ICON_CLASS
);
}
function
init
()
{
// Enhance previously added items.
Array
.
prototype
.
forEach
.
call
(
document
.
querySelectorAll
(
TABS_SELECTOR
+
' '
+
LIST_ITEM_JS_SELECTOR
),
addNoIconClass
);
mw
.
hook
(
'util.addPortletLink'
).
add
(
/**
* @param {HTMLElement} item
*/
(
item
)
=>
{
// Check if this menu item belongs to a tabs menu.
if
(
item
.
closest
(
TABS_SELECTOR
)
)
{
addNoIconClass
(
item
);
}
}
);
}
module
.
exports
=
init
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 8 2026, 22:15 (7 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
21/3e/f5ffb60732498ab8292f6a719a4e
Default Alt Text
menuTabs.js (842 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment