Closed boomshakar closed 2 years ago
Hi @artf, I was able to get what I want by triggering click() on the button itself,
`
const modal = edit.Modal;
const query = new URLSearchParams(location.search);
const uploadQuery = query.get('key');
if (uploadQuery === 'upload-code') {
const importClick = document.querySelector('.gjs-pn-btn.fa.fa-download');
importClick.click();
edit.on('modal', (e) => {
if (e.open && e.title.textContent === 'Import template') {
modal.setTitle('<div>Import your Template [inline-html/css]</div>');
}
});
}
`
If there's a better workaround, i'd be glad If you share with me the knowledge. Thanks.
@boomshakar please don't convert discussions to issues
@boomshakar please don't convert discussions to issues
Noted. Thanks
Hello, Please i'm in need of the logic on how to the import template modal on initialization of the page... I'm using the newsletter preset plugin What i'm trying to achieve?: Make the user upload their code once the page has been loaded. Below are the logics I've tried,
` editor.on('load',(model, argument )=> {
}`
Originally posted by @boomshakar in https://github.com/artf/grapesjs/discussions/4272