Changes

Jump to: navigation, search

MediaWiki:Common.js

14 bytes added, 00:00, 14 December 2024
m
no edit summary
function tabberGoTo(thisElement, tabName, id) {
let tabbertab = thisElement;
while (!tabbertab.classList.contains('tabbertab')) {
}
const tabberParent = tabbertab.parentElement; const tabberChildren = Array.from(tabberParent.children);
// Switch tabs
tabbertab.style.display = 'none'; tabberChildren.find(child => child.title === tabName).style.display = 'block';
// Handle tabbernav CSS
const nav = tabberChildren.find(child => child.classList.contains('tabbernav'));
for (const child of Array.from(nav.children)) {
if (child.firstElementChild.title === tabbertab.title) { child.classList = ''} if (child.firstElementChild.title === tabName) { child.classList = 'tabberactive'}
}
document.getElementById(id).scrollIntoView({ behavior: "smooth", block: "end" })
}
WikiDefender, bureaucrat, administrator
721
edits

Navigation menu