Page MenuHomePhabricator

toc hide on live preview doesn't work anymore
Closed, ResolvedPublic

Description

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


Version: 1.23.0
Severity: normal

Details

Reference
bz60030

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:52 AM
bzimport set Reference to bz60030.

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