Issue #651Opened December 15, 2017by AH1N10 reactions

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)

artfDecember 19, 20170 reactions

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);
lock[bot]September 18, 20190 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.