Skip to content
Snippets Groups Projects
Select Git revision
  • f077f3dd6f184be15bf09928ae8336593c8d6abc
  • master default protected
  • 1.31
  • 4.38.2
  • 4.38.1
  • 4.38.0
  • 4.37.2
  • 4.37.1
  • 4.37.0
  • 4.36.0
  • 4.35.0
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
  • 4.32.0
  • 4.31.0
  • 4.30.1
  • 4.30.0
  • 4.29.1
  • 4.29.0
23 results

fix-navbar.js

Blame
  • fix-navbar.js 857 B
    /* global document */
    (function() {
        function setNavbarMainContentHeight() {
            var heading = document.querySelector('#navbar-heading');
            var searchBox = document.querySelector('#search-box');
            var sidebarMainContent = document.querySelector('#sidebar-main-content');
    
            var heightToSubtract = 32;
    
            if (heading) {
                heightToSubtract += heading.getBoundingClientRect().height;
            }
    
            if (searchBox) {
                heightToSubtract += searchBox.getBoundingClientRect().height;
            }
    
            // eslint-disable-next-line no-undef
            sidebarMainContent.style.height += window.innerHeight - heightToSubtract + 'px';
        }
    
        setNavbarMainContentHeight();
        // eslint-disable-next-line no-undef
        window.addEventListener('resize', setNavbarMainContentHeight);
    })();