disable/hide Style Manager
Question
I want user to provide a component's id before they could edit it's styles. To do so i need to disable/ hide Style Manager for some component untill user goves it's i. How can i do it?
Answers (2)
Hi @AH1N1 you could set up this
const sm = document.getElementById('gjs-sm-sectors');
const updateStyleManager = () => {
const model = editor.getSelected();
sm.style.display = model.getAttributes()['id'] ? 'block' : 'none';
}
// Triggers on component change
editor.on('component:selected', updateStyleManager);
// Triggers when you update component's attributes
editor.on('component:update:attributes', updateStyleManager);
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 #1322
Disable editing in Preview Mode.
@artf How can we disable editing in the preview mode and re-enable it when preview mode off. I want to remove editor and hide toolbar in th...
Issue #1091
How to select the first Component
I want to launch the editor with the style manager visible and populated. Meaning that a component is selected by default and the style man...
Issue #535
New section in View Container
Hello, I want to add a new section in view container. Lets say, when we click Style manager it opens style manager. I want to create simila...
Issue #1822
[QUESTION] - Add style sector for specific Css rule
Hey @artf , COuld you give your help on this one? I want to disable the user to able to select the wrapper block (body) but I still want to...
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.