Jump to content

MediaWiki:Vector-2022.js: Difference between revisions

From Climbopedia
m fixing the last edit
m testing - debugging
Line 10: Line 10:


     $('.vector-header-container').prepend('<div class="custom-header-container-overlay"></div>');
     $('.vector-header-container').prepend('<div class="custom-header-container-overlay"></div>');
     $('.custom-custom-header-container-overlay').css(
     $('.custom-custom-header-container-overlay').css({
        {'height':$('.vector-header-container').height,
        'height': $('.vector-header-container').height,
         'position': 'absolute'});
         'position': 'absolute'});



Revision as of 20:40, 8 November 2025

$(function() {
    // create body overlay
    $('body').children().wrapAll('<div class="mw-body-wrapper"></div>');

    // create object just for backgrounds
    $('.mw-body-wrapper').prepend('<div class="custom-bg-overlay"></div>');
    $('.custom-bg-overlay').css({'height': $('.mw-body-wrapper').height(),
                                 'position': 'absolute',
                                 'pointer-events': 'none'});

    $('.vector-header-container').prepend('<div class="custom-header-container-overlay"></div>');
    $('.custom-custom-header-container-overlay').css({
         'height': $('.vector-header-container').height,
         'position': 'absolute'});

    const ro = new ResizeObserver(([entry]) => {
        $('.custom-bg-overlay').height($('.mw-body-wrapper').height());
    });

    ro.observe($('.mw-body-wrapper')[0]);
});