More actions
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 4: | Line 4: | ||
$content.find('.citizen-section').each(function() { | $content.find('.citizen-section').each(function() { | ||
var $section = $(this); | var $section = $(this); | ||
$section. | var $contentWrapper = $section.find('.citizen-section-content'); | ||
var $title = $section.find('.citizen-section-title'); | |||
// | if ($contentWrapper.length && $title.length) { | ||
// Collapse by default | |||
$contentWrapper.hide(); | |||
$section.addClass('collapsed'); | |||
// Make the title clickable to toggle the section | |||
$title.css('cursor', 'pointer').on('click', function() { | |||
$contentWrapper.slideToggle(); | |||
$section.toggleClass('collapsed'); | |||
}); | |||
} | |||
}); | }); | ||
}); | }); |
Revision as of 04:07, 2 April 2025
/* All JavaScript here will be loaded for users of the Citizen skin */ mw.hook('wikipage.content').add(function($content) { $content.find('.citizen-section').each(function() { var $section = $(this); var $contentWrapper = $section.find('.citizen-section-content'); var $title = $section.find('.citizen-section-title'); if ($contentWrapper.length && $title.length) { // Collapse by default $contentWrapper.hide(); $section.addClass('collapsed'); // Make the title clickable to toggle the section $title.css('cursor', 'pointer').on('click', function() { $contentWrapper.slideToggle(); $section.toggleClass('collapsed'); }); } }); });