MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
(Created page with "→CSS placed here will be applied to all skins: →Hides the rollback option. Not needed when we don't have large vandalism issues.: .mw-rollback-link { display: none; }") |
(Implemented section-collapse and stop-section-collapse.) |
||
Line 4: | Line 4: | ||
.mw-rollback-link { | .mw-rollback-link { | ||
display: none; | display: none; | ||
} | |||
/* Implements section-collapse and stop-section-collapse */ | |||
var collapsing = document.querySelectorAll(".section-collapse"); | |||
if (collapsing.length>0) { | |||
for (var i = 0; i < collapsing.length ; i++) { | |||
collapsing.item(i).addEventListener('click',collapseHandler,false); | |||
} | |||
} | |||
function collapseHandler() { | |||
var c = this.parentNode.parentNode.nextSibling; | |||
while (c) { | |||
if (c.classList) { | |||
if (c.classList.contains("section-collapse") || c.classList.contains("stop-section-collapse")) | |||
break; | |||
c.classList.toggle('section-collapsed'); | |||
} | |||
c = c.nextSibling; | |||
} | |||
this.classList.toggle('collapsed-icon'); | |||
} | } |
Revision as of 08:40, 7 April 2019
/* CSS placed here will be applied to all skins */ /* Hides the rollback option. Not needed when we don't have large vandalism issues. */ .mw-rollback-link { display: none; } /* Implements section-collapse and stop-section-collapse */ var collapsing = document.querySelectorAll(".section-collapse"); if (collapsing.length>0) { for (var i = 0; i < collapsing.length ; i++) { collapsing.item(i).addEventListener('click',collapseHandler,false); } } function collapseHandler() { var c = this.parentNode.parentNode.nextSibling; while (c) { if (c.classList) { if (c.classList.contains("section-collapse") || c.classList.contains("stop-section-collapse")) break; c.classList.toggle('section-collapsed'); } c = c.nextSibling; } this.classList.toggle('collapsed-icon'); }