- Affected version
- 2.3.10
If the location hash points to ignored content, this content should be unhidden so scrolling works correctly.
This does not work in XenForo 2.3 due to a bug that was introduced when removing jQuery.
XenForo 2.2 JS
XenForo 2.3 JS
The vanilla JS code requires that
This does not work in XenForo 2.3 due to a bug that was introduced when removing jQuery.
XenForo 2.2 JS
Code:
initializeHash: function()
{
if (window.location.hash)
{
var cleanedHash = window.location.hash.replace(/[^\w_#-]/g, '');
if (cleanedHash === '#')
{
return;
}
var $jump = $(cleanedHash),
XenForo 2.3 JS
Code:
initializeHash ()
{
if (window.location.hash)
{
const cleanedHash = window.location.hash.replace(/[^\w_#-]/g, '')
if (cleanedHash === '#')
{
return
}
const jump = document.getElementById(cleanedHash)
The vanilla JS code requires that
cleanedHash does not contain the # to make getElementById successful.
Last edited: