GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
628 stars 226 forks source link

Default Open Blocks #233

Closed mdkbdg closed 1 year ago

mdkbdg commented 3 years ago

Trying to make "Open Blocks" as default panel when it is open the very first time.

Refering to https://github.com/artf/grapesjs/issues/454

editor.Panels.getButton('views', 'open-blocks').set('active', true)

But when I add the above line, the panel is empty. 'autorender' is not defined which supposed to have its default value

How to make Open Blocks as default opened panel?


What is supposed to look : image

How it look now : image

mdkbdg commented 3 years ago

Aha!

I just found it and it now works. Here is how

...
autorender: false
...

editor.on('load', function(){ editor.Panels.getButton('views', 'open-blocks').set('active', true) });
editor.render();

Might help someone