Closed thomasfrobieter closed 7 years ago
When triggered frome here, this event will fire quite frequently:
Once on every form element, everytime checkDirty, resetDirty, SaveData or updateSection are called.
Are you sure you really need them this way? We also have the "editor_area:loaded" event
Yes editor_area:loaded is exactly what i need, thank you! I just saw the "CustomSection:updated" callback. Can we add a list of callbacks to the description / readme?
AFAIK, we currently only trigger the "CustomSection:updated" custom event in $gp.response.updateContent() Another way to execute JS is to write a
CustomSections.onUpdate = function(){
$(this).doSomething(); // this is the currently edited section
};
which will be called in the same response.
editor_area:loaded will be triggered by Typesetter/inline_editing.js.
Some other useful events: section_sorting:loaded section_options:loaded SectionAdded SectionSorted PreviewAdded PreviewRemoved SectionRemoved
Yeah i think you have shown me this callbacks a while a go, i already saved it (http://blog.frobieter.de/content/typesetter-documentation) - except editor_area:loaded :)
Thank's again!
But the CustomSection:formElementsLoaded is still very helpfull, as it fires also if a bunch control popup is loaded.
CustomSection:formElementsLoaded fires way to often on the position i choosed -_- I think we can remove it.
But i added some more helpfull callbacks for bunch controls, i will push the changes.
regarding SectionCopied:
i already saved it (http://blog.frobieter.de/content/typesetter-documentation) -> SectionCopied (Unclear - looks like only SectionAdded fired if a section is copied)
True. CopySection() in fact creates a clone (non-deep) via JS, which is - from the CMS point-of-view - nothing but an additional section, once saved. Source and copy aren't linked in any way (no inheritance or common properties). Therefore the SectionAdded event gets fired.
Hmm, maybe we should also fire a "SectionCopied" event, e.g. for cases where we need to generate new unique ids. Actually, IMO such ids should be (re)generated client-side when SectionAdded fires.
Hey,
can we please add some more callback funktions inside the universal_editor/editor.js? Currently we just have "CustomSection:updated" available.
Specificly i added: