Table of contents toggles don't work correctly after update

* This was fixed by removing the reattachment of `SubsectionToggleListeners`, as it seems to be already attached and was double toggling on click.
* This will not work with full TOC collapse `CollapseToggleListeners` it has to be reattached for it to work

Bug: T316033
Change-Id: I756b2a929fd94d9167a7b56df668b1202e695a38
This commit is contained in:
Moh'd Khier Abualruz 2022-08-25 14:19:37 +02:00
parent af4d269af7
commit 6b91d66eee

View file

@ -410,8 +410,6 @@ module.exports = function tableOfContents( props ) {
function reloadTableOfContents( sections ) {
mw.loader.using( 'mediawiki.template.mustache' ).then( () => {
reloadPartialHTML( getTableOfContentsHTML( sections ), TOC_ID );
// Rebind event listeners.
bindSubsectionToggleListeners();
// Reexpand sections that were expanded before the table of contents was reloaded.
reExpandSections();
// Initialize Collapse toggle buttons