refactor(core): remove duplicated check for ToC

This commit is contained in:
alistair3149 2022-05-12 23:24:32 -04:00
parent 1a86f0f88b
commit 13a2b710ea
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C

View file

@ -3,7 +3,7 @@
*
* @return {void}
*/
function intersectionHandler() {
function initToC() {
const headlines = document.querySelectorAll( '.mw-headline' ),
toc = document.getElementById( 'toc' ),
marginTop = '-' + window.getComputedStyle( document.documentElement ).getPropertyValue( 'scroll-padding-top' );
@ -38,16 +38,6 @@ function intersectionHandler() {
}
}
/**
* @return {void}
*/
function initTOC() {
// Check for has-toc class since it is loaded way before #toc is present
if ( document.querySelector( '.citizen-toc-enabled' ) ) {
intersectionHandler();
}
}
module.exports = {
init: initTOC
init: initToC
};