PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

MediaWiki:Common.js: Difference between revisions

From PC Gaming Shelter
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 15: Line 15:
}
}
   }
   }
   const panel = document.querySelector('.right-panel')
   const panel = document.querySelector('.right-sidebar')
   panel.style.right = '-274px';
   if (panel) {
    panel.style.right = '-274px';
  }
}
}

Revision as of 21:52, 19 March 2026

/* Any JavaScript here will be loaded for all users on every page load. */

$(function() {
	managePersonalIconVis();
});

function managePersonalIconVis(){
  if (mw.config.get('wgUserId') !== null) {
	const personal = document.getElementById('p-personal');
	document.querySelector('#pane4').appendChild(personal);
  } else {
	const personalIcon = document.querySelector('.personal-tools-icon');
	if (personalIcon) {
		personalIcon.classList.add('d-none');
	}
  }
  const panel = document.querySelector('.right-sidebar')
  if (panel) {
     panel.style.right = '-274px';
  }
}