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

Can the admin pageparts emit an event when a new patepart is created? #695

Closed
tarjei opened this issue Sep 7, 2015 · 2 comments · Fixed by #740
Closed

Can the admin pageparts emit an event when a new patepart is created? #695

tarjei opened this issue Sep 7, 2015 · 2 comments · Fixed by #740

Comments

@tarjei
Copy link
Contributor

tarjei commented Sep 7, 2015

Hi, I've made a pagepart that uses some JS in the admin form to show / hide fields and also to run a select2 selector on one of the fields. My problem now is in having an event to hook up some init code when a new pagepart is created.

Would it be possible for _pagepart_editor.js to emit an event when a new pagepart is created containing some metadata (pagepart class for example) that external scripts could listen to?

@roderik
Copy link
Contributor

roderik commented Sep 10, 2015

Seems like a good addition, can you send a PR?

@tarjei
Copy link
Contributor Author

tarjei commented Sep 10, 2015

I'll see what I can cook up. Any input on conventions in the code I should be aware of? Do you do something like this somewhere else?

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

Successfully merging a pull request may close this issue.

2 participants