Hello,
I want all the categories listed in Blocks, must be initially in collapsed condition when the Grapes JS Editor is loaded. How can I do that? Also, if any one category is clicked, all others gets closed just like accordion. Is this possible?

Thanks!
Try with this
const categories = editor.BlockManager.getCategories();
categories.each(category => {
category.set('open', false).on('change:open', opened => {
opened.get('open') && categories.each(category => {
category !== opened && category.set('open', false)
})
})
})
Wow man, Thanks a lot!
Sneak Peak:

:heart_eyes:
awesome 馃槏
i know we can add a class for font-awsome etc, but how did you changed it to show previews/custom thumbnails?
Give your custom class and set styles with the background image
Eg Code:
In bm.add block
attributes: {
class: 'custom-icon flowz-callToAction-style-2',
title: 'Style 2',
},
and in CSS
.custom-icon {
padding:0 !important;
width:100px !important;
height:50px !important;
min-height: auto !important
}
.flowz-callToAction-style-2{
background:url(screenshots/callToAction/2.jpg) no-repeat;
background-size:100% 100%
}
Thanks, sometimes the answer's something so simple, you can't just get it on your head hahah :P
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Try with this