MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
AdminIsidore (talk | contribs) No edit summary |
AdminIsidore (talk | contribs) No edit summary |
||
Line 8: | Line 8: | ||
} | } | ||
} ); | } ); | ||
// | |||
/* Vulgate */ | |||
var | // Function to resize parchment backgrounds to match content height | ||
function resizeParchments() { | |||
var containers = document.querySelectorAll('.vulgate-container'); | |||
containers.forEach(function(container) { | |||
var content = container.querySelector('.vulgate-content'); | |||
var parchment = container.querySelector('.vulgate-parchment'); | |||
if (content && parchment) { | |||
parchment.style.height = content.offsetHeight + 'px'; | |||
} | |||
}); | |||
} | |||
// Run on initial page load and after any window resizing | |||
$(document).ready(resizeParchments); | |||
$(window).on('resize', resizeParchments); |