mirror of
https://github.com/discourse/DiscoTOC.git
synced 2025-03-06 17:30:16 +00:00
DEV: the afterRender queue is too late
Since the component adds dynamic id attributes to headings that don't have ids, we need to do things a bit sooner otherwise external linking to an anchor of a heading with dynamic id will not work.
This commit is contained in:
parent
6eebb21760
commit
4f25b2d213
@ -257,7 +257,7 @@
|
|||||||
})(() => {});
|
})(() => {});
|
||||||
|
|
||||||
api.decorateCooked($elem => {
|
api.decorateCooked($elem => {
|
||||||
run.scheduleOnce("afterRender", () => {
|
run.scheduleOnce("actions", () => {
|
||||||
if ($elem.hasClass("d-editor-preview")) return;
|
if ($elem.hasClass("d-editor-preview")) return;
|
||||||
if (!$elem.parents("article#post_1").length) return;
|
if (!$elem.parents("article#post_1").length) return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user