mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-28 00:01:05 +00:00
refactor(core): merge ToC script into core scripts
This commit is contained in:
parent
e0d5eb9657
commit
508c96ae9d
|
@ -307,7 +307,6 @@ class SkinCitizen extends SkinMustache {
|
|||
}
|
||||
|
||||
// Table of content highlight
|
||||
$options['scripts'][] = 'skins.citizen.scripts.toc';
|
||||
$options['styles'][] = 'skins.citizen.styles.toc';
|
||||
|
||||
// Drawer sitestats
|
||||
|
|
|
@ -113,7 +113,8 @@ function onTitleHidden( document ) {
|
|||
*/
|
||||
function main( window ) {
|
||||
const theme = require( './theme.js' ),
|
||||
search = require( './search.js' );
|
||||
search = require( './search.js' ),
|
||||
toc = require( './tableOfContents.js' );
|
||||
|
||||
enableCssAnimations( window.document );
|
||||
theme.init( window );
|
||||
|
@ -125,6 +126,15 @@ function main( window ) {
|
|||
document.documentElement.classList.add( 'citizen-loading' );
|
||||
}, false );
|
||||
|
||||
// TODO: This need some serious refactoring
|
||||
// * Have a function to define checkbox targets then pass it to init
|
||||
// * initCheckboxHack needs should take such objects as parameter
|
||||
// * We shouldn't get the toc element multitple times
|
||||
// * Need to consolidate scroll and intersection handlers
|
||||
if ( document.getElementById( 'toc' ) ) {
|
||||
toc.init();
|
||||
}
|
||||
|
||||
mw.loader.load( 'skins.citizen.preferences' );
|
||||
}
|
||||
|
||||
|
|
|
@ -48,4 +48,6 @@ function initTOC() {
|
|||
}
|
||||
}
|
||||
|
||||
initTOC();
|
||||
module.exports = {
|
||||
init: initTOC
|
||||
};
|
|
@ -195,15 +195,6 @@
|
|||
"mobile"
|
||||
]
|
||||
},
|
||||
"skins.citizen.scripts.toc": {
|
||||
"scripts": [
|
||||
"resources/skins.citizen.scripts.toc/skins.citizen.scripts.toc.js"
|
||||
],
|
||||
"targets": [
|
||||
"desktop",
|
||||
"mobile"
|
||||
]
|
||||
},
|
||||
"skins.citizen.scripts.drawer": {
|
||||
"scripts": [
|
||||
"resources/skins.citizen.scripts.drawer/skins.citizen.scripts.drawer.js"
|
||||
|
|
Loading…
Reference in a new issue