MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 19: | Line 19: | ||
} | } | ||
} | } | ||
Revision as of 01:24, 12 April 2026
/* Force main menu to be pinned on desktop */
$(document).ready(function() {
// Force pin the main menu
var pinnedContainer = document.getElementById('vector-main-menu-pinned-container');
var unpinnedContainer = document.getElementById('vector-main-menu-unpinned-container');
var mainMenu = document.getElementById('vector-main-menu');
if (window.innerWidth >= 1024) {
if (unpinnedContainer && mainMenu) {
// Move menu to pinned container if not already there
if (pinnedContainer && !pinnedContainer.contains(mainMenu)) {
pinnedContainer.appendChild(mainMenu);
}
}
// Click the pin button if it exists
var pinButton = document.querySelector('.vector-pinnable-header-pin-button');
if (pinButton) {
pinButton.click();
}
}