Last modified: 2014-02-01 02:20:17 UTC
Since https://gerrit.wikimedia.org/r/101470 hiding of toc in live preview doesn't work anymore, because the hook is fired when the content is detached and the toc hiding code search on the attached content. Reproduced in Mozilla Firefox and Google Chrome. Solution: Use $content of the hook
Change 107337 had a related patch set uploaded by Gerrit Patch Uploader: (Bug 60030) Use $content of the hook for toc hiding https://gerrit.wikimedia.org/r/107337
Change 106132 had a related patch set uploaded by Gerrit Patch Uploader: Move toctoggle from mediawiki.util.js to separate file mediawiki.toc.js https://gerrit.wikimedia.org/r/106132
Change 107337 merged by jenkins-bot: (Bug 60030) Use $content of the hook for toc hiding https://gerrit.wikimedia.org/r/107337
Wait, I'm not sure about the status of this now – only one patch was merged so far. Are both require or just that one?
(In reply to comment #4) > Are both require or just that one? Both are required. With the first patch a toc toggle for the preview is possible again but the toggle of the preview may toggle the toc of the content instead of the preview if there is also a toc in the content.
For code regression the change https://gerrit.wikimedia.org/r/107337 is sufficient. https://gerrit.wikimedia.org/r/106132 solves additional problems when there are multiple table of contents.
Change 106132 merged by jenkins-bot: Move toctoggle from mediawiki.util.js to separate file mediawiki.toc.js https://gerrit.wikimedia.org/r/106132