[Question]: $('.gjs-trt-traits') is null (trying to have 'Settings' sector under the style)
Question
Hi,
I'm using webpage preset and trying to have Settings sector under Style like the demo by doing this (exactly the same as demo.html) but the problem that i have is $('.gjs-trt-traits') this is null therefore, if I toggle 'Settings' under Styles, it is empty. Please let me know..Thank you!
var traitsSector = $('<div class="gjs-sm-sector no-select">'+
'<div class="gjs-sm-title"><span class="icon-settings fa fa-cog"></span> Settings</div>' +
'<div class="gjs-sm-properties" style="display: none;"></div></div>');
var traitsProps = traitsSector.find('.gjs-sm-properties');
traitsProps.append($('.gjs-trt-traits'));
$('.gjs-sm-sectors').before(traitsSector);
traitsSector.find('.gjs-sm-title').on('click', function(){
var traitStyle = traitsProps.get(0).style;
var hidden = traitStyle.display == 'none';
if (hidden) {
traitStyle.display = 'block';
} else {
traitStyle.display = 'none';
}Answers (2)
Traits are not created by default if not requested, indeed I'm doing this in the demo https://github.com/artf/grapesjs/blob/gh-pages/demo.html#L1407-L1408
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.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1639
[Question]: Would it be possible to have change settings under style manager in a way that it has href when a link is created?
I'm using preset newsletter with built-in RTE (do not want to use ck editor like the demo) In order to make any text to link, i need to cli...
Issue #1137
Cant make Text Block not editable and style able at the same time !
Demo / reproduce problem https://jsfiddle.net/shareefhiasat/u8Lodyh7/1/ Question Not sure if its bug or i dont know how to get the desired...
Issue #1875
[QUESTION] ID changes when importing html or passing html in components prop in config.
Hi, I built a component and block that I can drag and drop in the canvas. My issue is that some styles rely on the ID. I know this might no...
Issue #516
How to embed setting panel into style manager panel.
In grapesjs.com/demo.html settings panel is embedded into style manager panel. I want the same thing but I could not find how can it be.
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.