editor-api icon indicating copy to clipboard operation
editor-api copied to clipboard

Apply changes API

Open mathiassoeholm opened this issue 3 years ago • 2 comments

Hi 👋

Thanks for a lot providing this API, I was able to automate everything I needed to apart from this last thing :-) I'm missing the ability to apply the changes I made on some instantiated templates. The equivalent of clicking the Apply All button:

Screenshot 2022-12-08 at 09 45 08

Is there an API for that, which I have simply missed? Or is it not possible via the editor API yet?

mathiassoeholm avatar Dec 08 '22 08:12 mathiassoeholm

I don't believe Revert All, Revert and Apply All are part of the public API. There would be private API in the Editor UI code that you could call in the meantime if it's needed for you

If you open source maps for the Editor page, look for the file templates-entity-inspector.js and you can see what functions are bound to those buttons.

yaustar avatar Dec 08 '22 09:12 yaustar

Thanks! I figured out that I can just call:

window.editor.call('templates:apply', entity);

mathiassoeholm avatar Dec 08 '22 10:12 mathiassoeholm