Skip to content

Not possible to use/integrate schemaeditor outside autotoc tabs #55

@seanupton

Description

@seanupton

Since 2.0.16 (and this commit), there is a regression in the ability to use the schema editor outside of autotoc tabs (on pages where autotoc pattern is unused).

For my purposes, this is a regression. The only way (for me) to work around this is to call require('pat-registry').patterns.autotoc.init($('<div>').appendTo('body').hide()) (add dummy element to body, init autotoc on it, then hide it) to trigger that patterns init event. Obviously this is not a problem for core use inside Dexterity types control panel, but this might affect add-ons beside my own.

@thet what was the "wait until autotoc is ready" use case? Was there an order issue affecting the Dexterity Types CP?

I wonder if there also a reasonable way to expose the ability to initialize the schema editor imperatively, but the zero-namespace IIFE the code is inside now preempts that? Exporting a namespace from a return value of the IIFE seems a reasonable compromise?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions