MediaWiki:Common.js: Difference between revisions

Content added Content deleted
m (make catlinks collapse hook adhere to emcascript 5)
mNo edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */

if (mw.config.get('skin') == 'timeless') {
mw.hook('wikipage.categories').add(function (content){
if (content[0].id == 'catlinks' && content[0].childElementCount > 0) {
content
.wrap('<details></details>')
.closest('details')
.prepend('<summary>Show full category list</summary>');
}
});
}

Revision as of 21:02, 23 February 2022

/* Any JavaScript here will be loaded for all users on every page load. */