Issue #3255Opened February 1, 2021by Abhisheknanda13444633 reactions

Custom Style Manager

Question

Hi @artf
I am trying to change the type and input values of display property like this way -: But on style-manager Button are not visible. How can we customize the display property


const styleManager = editor.StyleManager;
  styleManager.addSector('div-only-sector',{
    name: 'Setting',
    open: true,
    buildProps: ['width',  'height'],
    properties: [{ 
      name: 'Visibility',
      property: 'display',
      type: 'radio',
      properties: [
        {value: 'inherit', title: 'Visiblity'},
        {value: 'none', title: 'Hidden'}
       ],
    }]
 });

Demo -: https://codepen.io/abhi_punk81/pen/MWbWzaq?editors=0010

Could you Please Help @artf ? Thanks

Answers (2)

nilchuFebruary 1, 20213 reactions

You have to use the list property to define your options. Inside the radio option objects, it should read name instead of title.


const styleManager = editor.StyleManager;
styleManager.addSector('div-only-sector', {
    name: 'Setting',
    open: true,
    buildProps: ['width', 'height'],
    properties: [{
        name: 'Visibility',
        property: 'display',
        type: 'radio',
        list: [{
            name: 'Visibility',
            value: 'inherit'
        }, {
            name: 'Hidden',
            value: 'none'
        }]
    }]
});
Abhisheknanda1344463February 3, 20210 reactions

Thanks A lot @nilchu for your help.

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.