2021-10-20 18:58:49 +00:00
|
|
|
// Enable Vector features limited to ES6 browse
|
|
|
|
const stickyHeader = require( './stickyHeader.js' ),
|
|
|
|
searchToggle = require( './searchToggle.js' );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return {void}
|
|
|
|
*/
|
|
|
|
const main = () => {
|
|
|
|
// Initialize the search toggle for the main header only. The sticky header
|
|
|
|
// toggle is initialized after wvui search loads.
|
2021-10-20 19:10:42 +00:00
|
|
|
const searchToggleElement = document.querySelector( '.mw-header .search-toggle' );
|
|
|
|
if ( searchToggleElement ) {
|
|
|
|
searchToggle( searchToggleElement );
|
|
|
|
}
|
2021-10-20 18:58:49 +00:00
|
|
|
stickyHeader();
|
2021-10-20 19:10:42 +00:00
|
|
|
};
|
2021-10-20 18:58:49 +00:00
|
|
|
|
|
|
|
if ( document.readyState === 'interactive' || document.readyState === 'complete' ) {
|
|
|
|
main();
|
|
|
|
} else {
|
|
|
|
// This is needed when document.readyState === 'loading'.
|
|
|
|
document.addEventListener( 'DOMContentLoaded', () => main );
|
|
|
|
}
|