In Plone 5: creating a new content objects from the folder_contents view performs a POST to ++add++SOMETYPE in order to retrieve the addform and display it as popup.
I have a custom Dexterity and a custom Dexterity field which renders as a textarea and attaches the ACE editor
to the textarea.
In Plone 4 is was trivial doing this using $(document).ready(..)..
Things in Plone 5 are a bit more complicated. So what is the canonical way for decorating the textarea after it was rendered inside the add form popup. Should I hook using jQuery into some DOM change event listener?
You'll need to utilize some of the events that patterns fire off. It'll be something like this:
$('.pat-structure').off('init.structure.patterns').on('init.structure.patterns', function(){
// so now we know that structure is loaded and we can bind the add actions
$('.btn-group.addnew').off('init.modal.patterns').on('init.modal.patterns', function(){
// your code here
});
});