Initialize form editor after dom is loaded

We need window.wpApiSettings which is initialized by WordPress in page footer.
[MAILPOET-2750]
This commit is contained in:
Rostislav Wolny
2020-03-31 17:13:09 +02:00
committed by Veljko V
parent f01643b50f
commit c34eddd3be

View File

@@ -15,8 +15,8 @@ const App = () => (
</GlobalContext.Provider> </GlobalContext.Provider>
); );
window.addEventListener('DOMContentLoaded', () => {
const appElement = document.querySelector('#mailpoet_form_edit'); const appElement = document.querySelector('#mailpoet_form_edit');
if (appElement) { if (appElement) {
initStore(); initStore();
initBlocks(); initBlocks();
@@ -27,3 +27,4 @@ if (appElement) {
appElement appElement
); );
} }
});