Jump to content

MediaWiki:Vector-2022.js: Difference between revisions

From Climbopedia
m minor formatting adjustment
m fixing the last edit
Line 11: Line 11:
     $('.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:38, 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]);
});