MediaWiki:Vector-2022.js: Difference between revisions

m fixing the last edit
rewrote resize to observers for robustness
Line 17: Line 17:


     // Update on window resize
     // Update on window resize
     $(window).on('resize', function() {
 
     const ro_body = new ResizeObserver(([entry]) => {
         $('.custom-bg-overlay').height($('.mw-body-wrapper').height());
         $('.custom-bg-overlay').height($('.mw-body-wrapper').height());
    });
    ro_body.observe($('.mw-body-wrapper')[0]);
    const ro_bar = new ResizeObserver(([entry]) => {
         $('.custom-header-container-overlay').height($('.vector-header-container').height());
         $('.custom-header-container-overlay').height($('.vector-header-container').height());
     });
     });
    ro_bar.observe($('.vector-header-container')[0]);
});
});