I admin a wiki site running MediaWiki 1.29 and I have a problem collapsing the TOC on pages.
I would be interesting in keeping the Contents box, but loading the page with it collapsed by default.
It appears there is a simple solution here https://www.mediawiki.org/wiki/Manual_talk:Table_of_contents#Improved_Solution, but I fail to implement it and I have no idea where the error is, hopefully someone can help.
I integrated the code as explained and checked that
MediaWiki:Common.js is used by the site.
During page rendering, I checked the Java code is loaded and executed, but it appears to fail because
ReferenceError: toggleToc is not defined
I also checked this page https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#MediaWiki_1.29 , but in the table there is a empty cell where it should be explained how to migrate
toggleToc();. I am not even entirely sure it should be migrated.
Any help on this topic will be appreciated.