MediaWiki:Common.js: Difference between revisions
From PC Gaming Shelter
No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
function managePersonalIconVis(){ | function managePersonalIconVis(){ | ||
if (mw.config.get('wgUserId') !== | if (mw.config.get('wgUserId') !== undefined) { | ||
const personal = document.getElementById('p-personal'); | const personal = document.getElementById('p-personal'); | ||
document.querySelector('#pane4').appendChild(personal); | document.querySelector('#pane4').appendChild(personal); | ||
Revision as of 01:41, 17 March 2026
/* Any JavaScript here will be loaded for all users on every page load. */
$(function() {
managePersonalIconVis();
});
function managePersonalIconVis(){
if (mw.config.get('wgUserId') !== undefined) {
const personal = document.getElementById('p-personal');
document.querySelector('#pane4').appendChild(personal);
} else {
const personalIcon = document.querySelector('personal-tools-icon');
if (personalIcon) {
personalIcon.styles.visibility('hidden');
}
}
}
