juek / CustomSections

Developer plugin for rapid prototyping of custom section types in Typesetter CMS
GNU General Public License v2.0
3 stars 7 forks source link

New place to trigger ...:formElementsLoaded #65

Closed mahotilo closed 4 years ago

mahotilo commented 4 years ago

Now the CustomSection:formElementsLoaded event is triggered every time gp_editor.getFormElements is called. It means when section is saved, updated and Dirty-checked. This is too often and definitely not onLoaded. I have found a new place to trigger the event only when control elements are created.

mahotilo commented 4 years ago

If this event is useful in such implementation CustomSection:formElementsLoaded, it can be renamed to CustomSection:formElementsAccessed

UPD Yes, we need it. So I will take a pause to propose another patch

mahotilo commented 4 years ago

I think it’s better to introduce the new event CustomSection:EditorLoaded. Let CustomSection:formElementsLoaded fires every time it happens now. Also, with new function argument it is possible to make more detailed events, e.g. for update or saved.

juek commented 4 years ago

gp_editor.getFormElements = function(event="CustomSection:formElementsLoaded") doesn't look right. Looks more like PHP.

mahotilo commented 4 years ago

I agree, but we already have the same

https://github.com/juek/CustomSections/blob/1bf2c2292d01673fadaf008203081a5dac15a644/universal_editor/editor.js#L336

And already Bunch

juek commented 4 years ago

Hmm. Im' not sure if I already want to bind the plugin to ES6 browsers.

juek commented 4 years ago

Seems as if Android Webview joined the party last month. Hmm, well... then. But we have to be cautious in frontend scripts

juek commented 4 years ago

It's just because I only kicked Internet Explorer as admin browser in Typesetter 5.2-rc.