Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seanupton opened this issue Jun 29, 2017 · 1 comment
Open

Comments

@seanupton
Copy link
Member

seanupton commented Jun 29, 2017

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?

@seanupton seanupton changed the title Not possible to use/integrate schemaeditor Not possible to use/integrate schemaeditor outside autotoc tabs Jun 29, 2017
@thet
Copy link
Member

thet commented Sep 28, 2017

See my comment here: 896a5b8#commitcomment-24621313

The initialization part should check if pat-autotoc is used for the form where the schemaeditor is used and if not, initialize normally.

The reason for this change was, that you were not able to add fields to the current selected fieldset and for that to work I had to wait for autotoc to be initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants